Skip materializing globally-visible-deleted keys when reconstructing a disaggregated page from base image + deltas

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0
    • Affects Version/s: None
    • Component/s: Btree
    • None
    • Storage Engines - Transactions
    • 63.71
    • SE Transactions - 2026-07-31
    • 3

      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.

            Assignee:
            Chenhao Qu
            Reporter:
            Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: