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

Prepared transactions aren't properly cleared from global table with WT_CONN_LOG_DEBUG_MODE enabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT3.2.1
    • Component/s: None
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      Storage Engines 2019-08-12, Storage Engines 2019-08-26

      Description

      Given a prepared transaction we remove it's txnid from the global table at the end of the call to __wt_txn_prepare. On __wt_txn_commit we call __wt_txn_release which does the same thing except in the case of prepared transactions.

      		if (!F_ISSET(txn, WT_TXN_PREPARE))
      			__txn_remove_from_global_table(session);

      Now this wouldn't be an issue provided the prepared transaction wasn't being reallocated an id however when we commit the transaction calling __wt_txn_commit it calls __wt_txn_set_timestamp which calls __wt_txn_ts_log which if the flag WT_CONN_LOG_DEBUG is enabled calls __txn_logrec_init which calls ___wt_txn_id_check which then reallocates an id to our prepared txn. As such at the end of the call to __wt_txn_commit we don't clear our new id as our transaction is prepared which leaves an entry in the global table and blocks calls to rollback_to_stable when we're in debug mode.

      To reproduce this failure add the following assert to __wt_txn_id_check:

      WT_ASSERT(session, !F_ISSET(txn, WT_TXN_PREPARE));
      

      And run:

      ./buildscripts/resmoke.py --suite=replica_sets jstests/replsets/transactions_wait_for_write_concern.js
      

       In a debug build.

        Attachments

          Activity

            People

            • Assignee:
              alex.cameron Alex Cameron
              Reporter:
              luke.pearson Luke Pearson
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: