[SERVER-66725] Make incoming retryable transactions abort conflicting transactions once Created: 24/May/22  Updated: 29/Oct/23  Resolved: 09/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc10, 6.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Jack Mulrow Assignee: Jack Mulrow
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.0
Sprint: Sharding NYC 2022-05-30, Sharding NYC 2022-06-13
Participants:

 Description   

When a new retryable transaction runs on a mongod and a retryable transaction for the same client retryable write (ie same txnNumber in the session id) is active, the incoming transaction must wait for the existing transaction to complete, which happens via throwing a RetryableTransactionInProgress exception. This is meant to avoid a livelock if multiple routers are running the same client retryable write that requires retryable transactions, e.g. after a network error between a client and a mongos that leads the client to retry on a different mongos. A downside of this is if the router for the existing transaction has crashed or otherwise given up (e.g. after certain Interruption errors) the incoming transaction from the retry will wait for the existing transaction to time out. In practice, it is likely the original router has stopped running the transaction if a retry arrives, so the retry should interrupt the existing transaction. But to prevent livelocks if the original router is still running, only the first conflict should cause an interruption.



 Comments   
Comment by Githook User [ 09/Jun/22 ]

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-66725 SERVER-66659 Incoming retryable txns abort old txns and abort conflicting txns once

(cherry picked from commit bc385b8dcb5b7a550cefaada9d44bc9ded5164de)
Branch: v6.0
https://github.com/mongodb/mongo/commit/d12805a9e4af786e564ac21add3391aa7aaf8409

Comment by Githook User [ 09/Jun/22 ]

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-66725 SERVER-66659 Incoming retryable txns abort old txns and abort conflicting txns once
Branch: master
https://github.com/mongodb/mongo/commit/bc385b8dcb5b7a550cefaada9d44bc9ded5164de

Generated at Thu Feb 08 06:06:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.