Simplify the obsolete check logic

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0, 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: Btree
    • None
    • Storage Engines, Storage Engines - Transactions
    • SE Transactions - 2025-09-12
    • 3

              /*
               * WiredTiger internal operations such as rollback to stable and prepare transaction
               * rollback adds a globally visible tombstone to the update chain to remove the entire key.
               * Treating these globally visible tombstones as obsolete and trimming update list can cause
               * problems if the update chain is getting accessed somewhere else. To avoid this problem,
               * skip these globally visible tombstones from the update obsolete check that were generated
               * from prepare transaction rollback but not from RTS, because there are no concurrent
               * operations run in parallel to the RTS to be affected.
               */
              if (upd->txnid == WT_TXN_NONE && upd->upd_start_ts == WT_TS_NONE &&
                upd->type == WT_UPDATE_TOMBSTONE && upd->next != NULL &&
                upd->next->txnid == WT_TXN_ABORTED) {
                  WT_ACQUIRE_READ(prepare_state, upd->next->prepare_state);
                  /* We may see a locked prepare state if we race with prepare rollback. */
                  if (prepare_state == WT_PREPARE_INPROGRESS || prepare_state == WT_PREPARE_LOCKED)
                      continue;
              }
      

      This check in the obsolete check can be simplified because of the recent check.

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

              Created:
              Updated:
              Resolved: