-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code, Replication
-
Labels:None
-
Replication
-
ALL
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.