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

Restore _txnState to kNone before returning SnapshotTooOld error

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Internal Code, Replication
    • None
    • Replication
    • ALL

    Description

      When Session::unstashTransactionResources() throws a SnapshotTooOld error, we do not abort the transaction, since unstashTransactionResources() is not within the ScopeGuard that aborts the transaction. However, if the command was part of a multi-statement transaction, we leave the Session in a state where _txnState=kInProgress and _txnResourceStash is empty. This is an inconsistent state for the Session. It also means that when the mongos retries the first statement of the transaction, it must leave off the startTransaction argument, since the transaction is already in progress (which is incorrect). Instead, when we return a SnapshotTooOld error, we should "forget" that the current transaction ever happened, so that the mongos can retry with startTransaction:true.

      Attachments

        Activity

          People

            backlog-server-repl Backlog - Replication Team
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: