Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41269

Set txn state to in-progress when fetching active transaction state

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.14
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2019-06-03

      Currently, when fetching an active transaction, we don't set the result.state for in-progress transactions. This can be a problem for when we abort transactions on step-up. In that situation, we get the state of the ActiveTransactionHistory to be kNone which will cause the txn state to be set to kExecutableRetryableWrite.

      This can cause problems where we don't log metrics for transactions since the participant thinks it is a retryable write.

      Additionally, when this is fixed, it is possible to trigger an invariant in scenarios like in abort_in_progress_transactions_on_step_up.js. In this test, a node steps up from secondary to primary with an in-progress transaction already in place. This transaction was replicated from the last primary, and the node knows to abort it. However, in scenarios where the transaction is slow, we will try to log that transaction metric and hit the invariant since the startTime was never set on the secondary.

            Assignee:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Reporter:
            jason.chan@mongodb.com Jason Chan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: