Details
-
Task
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
Q4/2026 Server Development
Description
Read-path / transaction integration for MDEV-12163 — Materialized Views.
Scope (design + dev + code review together):
- THD::LOMV (list of materialised views used by current transaction) data structure + lifecycle.
- Table open path: in TDC, detect 'this is a materialised view'; check LOMV; either reuse the already-pinned TABLE_SHARE (so the transaction keeps reading a consistent version) or open the latest version and add a record / bump refcount in the registry.
- Same path under LOCK TABLES (open once at lock time; refcount adjusted at UNLOCK TABLES).
- Transaction end: walk LOMV, unlink each, decrement refcount; if it drops to 0 and a newer version exists, drop the now-obsolete versioned table and remove its registry record.
- Visibility guarantee: a long-running transaction continues reading the version it pinned, while new transactions see the latest version immediately.
- Code-review iteration.
Depends on: MDEV-12163's REFRESH VIEW side ticket (storage layout + registry).
Estimate baseline: ~11d (design + dev + code review combined).