Fix data race on btree->rec_max_txn and btree->rec_max_timestamp

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Btree
    • Storage Engines, Storage Engines - Transactions
    • 2024-07-23 - Mining crypto
    • 5

      This code in rec_write.c:

          /*
           * Track the tree's maximum transaction ID (used to decide if it's safe to discard the tree) and
           * maximum timestamp.
           */
          if (WT_TXNID_LT(btree->rec_max_txn, r->max_txn))
              btree->rec_max_txn = r->max_txn;
          if (btree->rec_max_timestamp < r->max_ts)
              btree->rec_max_timestamp = r->max_ts; 

      Can have two or more threads writing to the same btree, this is a race and the max may not be the true max. We should fix this.

            Assignee:
            Unassigned
            Reporter:
            Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: