[SERVER-34207] Restore _txnState to kNone before returning SnapshotTooOld error Created: 30/Mar/18 Updated: 27/Oct/23 Resolved: 17/Apr/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code, Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tess Avitabile (Inactive) | Assignee: | Backlog - Replication Team |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Replication
|
| Operating System: | ALL |
| Participants: |
| 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. |
| Comments |
| Comment by Tess Avitabile (Inactive) [ 30/Mar/18 ] |
|
I did not end up having to fix this issue in order to re-commit |