-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Layered Tables
-
None
-
Storage Engines - Foundations
-
None
-
None
When fixing WT-16695, several `if (leader)` checks were added in the layered cursor implementation, e.g. in `{}clayered_get_current`, `{}clayered_iterate_constituents`, `{_}_clayered_search_near`.
These guards effectively ignore the ingest cursor in leader mode to avoid states where the layered cursor reports itself as positioned but the stable cursor is not (and to avoid the associated WT_ASSERTs).
While this resolves WT-16695, it relies on the assumption that "ingest is empty in leader mode". That rule is likely to be violated by the upcoming work to support asynchronous draining from ingest to stable, where ingest may legitimately remain non-empty for some time after promotion.
Note that even before WT-16695, there was already existing code that checks `conn->layered_table_manager.leader`, so some of the code already assumes we always want the stable table in leader mode.
This ticket tracks:
- Clarifying and documenting the invariants for layered cursors when switching mode, including how ingest and stable cursors should be positioned and iterated.
- Replacing the current leader-specific guards with a cleaner, role-aware design that remains correct once async draining is enabled.
- Removing the FIXME-WT-16810 comments.
- is related to
-
WT-16695 Layered truncate: fix assert and re-enable test
-
- Closed
-