Background
When a disaggregated page is reconstructed from its base image plus deltas (_wti_page_merge_deltas_with_base_image_leaf in src/btree/bt_page.c), _time_window_clear_obsolete normalizes obsolete time windows before each cell is packed into the new image:
- a globally visible start has its start ts/txn cleared (
WT-16523), and - a globally visible stop has its stop ts/txn cleared (
WT-17577), to keep the reconstructed leaf cells consistent with the parent internal page's aggregate.
A key whose stop is globally visible is a globally visible delete: no reader can ever see it, and normal reconciliation already omits such key/value pairs when it writes a page. Materializing it in the reconstructed image (with a zeroed stop) is wasted work.
Proposal
In the merge loop, when a value's stop is globally visible (__wt_txn_tw_stop_visible_all), skip emitting the key/value entirely rather than packing a normalized cell. This applies to the base-only branch and to any kept delta value. The structural bookkeeping works out because entries, the EMPTY_V flags, and prefix compression against disk_s.last_key are all updated inside the pack call, so skipping the pack naturally contributes nothing and the next key prefix-compresses against the last emitted key. Start-clearing (WT-16523) is retained for live values.
Dropping a cell only lowers the child's aggregate, so child <= parent continues to hold; this also directly avoids the WT-17577 stop-leak and the WT-18087 start_ts > stop_ts class of window entirely.
Notes / things to confirm
- This is the shared history store, so dropping here is effectively early HS pruning on the read path. Confirm nothing (RTS, checkpoint cursor) relies on the record still being materialized after a read-reconstruction.
- The reconstructed image can be written back as a delta; confirm dropping at read time is equivalent to letting reconciliation drop it later (which already decides based on the writing node's visibility).
Follow-up to WT-18087 / WT-17885 (the minimal race fix that couples the stop/start clearing). This ticket supersedes the stop-clearing normalization for the base path.
- causes
-
WT-18166 [disagg] test/format disagg-switch: mirror data mismatch (table_verify_mirror base_keyno == table_keyno) after disagg_switch_roles
-
- Closed
-
- is fixed by
-
WT-17885 Optimize __time_window_clear_obsolete to check stop time point first
-
- Closed
-
-
WT-18087 Invalid argument: value time window has a start time after its stop time
-
- Closed
-
- is related to
-
WT-16523 Verify fails because of timestamps mismatch when writing deltas vs reading deltas
-
- Closed
-
-
WT-17885 Optimize __time_window_clear_obsolete to check stop time point first
-
- Closed
-
-
WT-18087 Invalid argument: value time window has a start time after its stop time
-
- Closed
-
-
WT-17577 Fix disaggregated leaf delta omitting base-image cells from its parent's time aggregate
-
- Closed
-
- related to
-
WT-18171 test/format (disagg.multi) assertion failure in __split_internal during eviction from eviction server thread
-
- In Progress
-