Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11744

Querying a timestamp on the global transaction can be off by one

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 3
    • StorEng - Defined Pipeline

      In txn_global_query_timestamp, when retrieving the all_durable timestamp, we walk the array of concurrent transactions, search for the minimum, and return a value one lower than that minimum.

      However, in the case where either the first transaction has the lowest durable timestamp, or there's only one transaction with a durable timestamp, we'd set `*tsp` one too high. I believe the code should look more like this:

              /* Walk the array of concurrent transactions. */
              WT_ORDERED_READ(session_cnt, conn->session_cnt);
              for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) {
                  __txn_get_durable_timestamp(s, &tmpts);
                  if (tmpts != 0 && (ts == 0 || tmpts < ts))
                      ts = tmpts;
              if (ts != 0)

      Also in scope: adding a test, and verifying the supposition that this should return a timestamp "one lower" than the lowest durable timestamp at all.

            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            will.korteland@mongodb.com Will Korteland
            0 Vote for this issue
            7 Start watching this issue