-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Cache and Eviction, Transactions
-
None
-
Storage Engines - Transactions
-
121.563
-
SE Transactions - 2026-12-04
-
5
Problem
WT-18533 stopped marking outdated disaggregated btrees WT_BTREE_READONLY on step-down, so that they can still take commits and rollbacks of prepared updates. An outdated btree is now identified by dhandle->outdated alone (__wt_btree_is_outdated_disagg()).
Eviction treats a dirty page of an outdated btree as discardable. In __wt_evict() (evict_page.c), for an outdated disaggregated btree and a page that is not clean-evictable:
- if dhandle->session_inuse > 0, return EBUSY and keep the page;
- otherwise clear the page's modified state and discard it as a clean page, without reconciling it.
That gate does not look at whether the page still holds unresolved prepared updates. Discarding such a page loses the prepared update from memory, while the transaction that prepared it can still be committed or rolled back later. The same assumption exists in the other places that treat an outdated btree as discardable: the early "always evictable" return in _wt_page_can_evict(), the sweep close of a modified outdated btree (sweep_close_dhandle_locked()), and the close-time discard in _wt_checkpoint_close().
To confirm
Whether session_inuse is guaranteed to stay non-zero for as long as any prepared update on the btree is unresolved. It is held by open cursors and by transactions with modifications on the handle, but it is not obvious that it also covers prepared updates instantiated from on-disk prepared cells, or prepared transactions resolved by a different session after the step-down. If it does not, the gate above is not enough.
Not reproduced; found by code reading of develop after WT-18533 merged.
Proposed direction
Make a dirty page of an outdated live btree that holds unresolved prepared updates not evictable until they are resolved, then let the existing clean-discard routing apply. Either:
- check the page for unresolved prepared updates in the outdated gate in _wt_evict() and return EBUSY, and keep the eviction walk and _wt_page_can_evict() consistent with that; or
- guarantee that the handle stays pinned while any prepared update on it is unresolved, and document that guarantee next to the gate.
Sweep and the close-time discard need the same protection.
Acceptance
A test on a disaggregated follower: leave a prepared update on a page of a stable btree across step-down, dirty and try to evict the page, check that it stays resident and that the prepared transaction can still be resolved, then check that the page is discarded once it is resolved.
Related
Depends on the design in "Design: Resolving Prepared Transactions on Disagg", which assumes outdated btrees can take commits of prepared updates.
- is related to
-
WT-18533 Read-only cursor scan can dirty a live stable btree across step-down - "disaggregated btree dirtied while not leader" assertion
-
- Closed
-
- related to
-
WT-18533 Read-only cursor scan can dirty a live stable btree across step-down - "disaggregated btree dirtied while not leader" assertion
-
- Closed
-