ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0, 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: Cursors
    • None
    • Storage Engines, Storage Engines - Transactions
    • 180.869
    • SE Transactions - 2026-11-20
    • 2

      Problem

      A prepared transaction on a follower writes the same key more than once, for example an insert and then a remove. If it is still prepared at step-up, the drain only sees its last write to that key.

      • On develop, step-up aborts when the key has no value in the stable table:
        __layered_assert_stable_btree_state: WiredTiger assertion failed: 'has_value || __wt_txn_upd_visible_all(...)'
      • With WT-18921, the abort is gone but the orphan remove count is wrong: insert then remove counts 1 (should be 0), and remove then insert counts 0 (should be 1).

      Cause

      When the drain reads the transaction's newest write to a key, it hands the transaction over to the stable table right away. That marks all of the transaction's writes to the key in the ingest table as aborted, so the drain skips the older ones.

      Fix

      Hand the transaction over only after the drain has read all writes to the key.

      Test

      Python test on a follower: a prepared transaction writes a key twice (insert and remove, in both orders) and is still prepared at step-up. Then commit or roll back, checkpoint and restart. Check that step-up succeeds, the value is correct, and the orphan count matches. Update the FIXME counts that WT-18921 leaves in test_layered_stepup17.py.

      Depends on WT-18921.

            Assignee:
            Zunyi Liu
            Reporter:
            Zunyi Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: