-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Reconciliation
-
Storage Engines - Transactions
-
210.154
-
SE Transactions - 2026-06-05
-
3
Background
In src/reconcile/rec_visibility.c, when reconciliation runs on a WT_BTREE_GARBAGE_COLLECT tree and the selected update is a committed preserved prepared transaction (prepared_id != WT_PREPARED_ID_NONE), the code cannot write that update to the on-disk image — doing so would strip the prepared transaction identifier from the disk cell, breaking the association with the unresolved prepared cell on the stable btree.
The current code handles this by nulling out upd_select->upd entirely:
if (F_ISSET(btree, WT_BTREE_GARBAGE_COLLECT) && upd_select->upd != NULL && upd_select->upd->prepared_id != WT_PREPARED_ID_NONE) { *has_newer_updatesp = true; upd_select->upd = NULL; }
Improvement
Instead of selecting NULL, reconciliation could walk back through the update chain from the selected update to find the most recent older update that:
- Is not aborted.
- Not from the same committed prepared transaction.
If such an update exists and is otherwise eligible to be written (e.g., globally visible or satisfies the existing visibility rules), it should be selected as the on-disk value. This avoids writing nothing when a valid older stable value is available, reducing the number of updates that must stay in memory and improving garbage collection efficiency in the ingest path.
Acceptance Criteria
- When the selected update is a committed preserved prepared transaction on a WT_BTREE_GARBAGE_COLLECT tree, reconciliation falls back to the nearest non-aborted, non-prepared older update rather than unconditionally setting upd_select->upd to NULL.
- If no such fallback update exists, behaviour is unchanged (NULL is selected, has_newer_updatesp is set).
- Existing test coverage for the garbage-collect / ingest prepared-transaction path continues to pass.
- related to
-
WT-17715 Ingest btree reconciliation asserts on non-prunable fallback update when WT_CONN_CLOSING makes all updates globally visible
-
- Closed
-