[SERVER-70247] SyncTransactionWithRetries used with SEPTransactionClient can leave transactions open when runNoThrow opCtx gets cancelled Created: 05/Oct/22  Updated: 29/Oct/23  Resolved: 03/Nov/22

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Jason Zhang
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-70248 Race in ShouldBeSafeToRetryOnStepDown... Closed
is related to SERVER-71649 Transaction API shouldn't block on an... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2022-10-17, Sharding NYC 2022-10-31, Sharding NYC 2022-11-14
Participants:

 Description   

Sequence of events:

  1. SyncTransactionWithRetries::runNoThrow gets called
  2. Waits for the transaction callback to finish here, but opCtx was cancelled so proceed to call cancel on the cancellation token
  3. If the transaction hasn't finished, it will try to abort it. But since it is using the client's runCommand to run abort, it will fail because it will try to use the token that was already cancelled to create the new opCtx for the abort command
  4. Transaction that was started at the beginning is just left in idle state.


 Comments   
Comment by Githook User [ 02/Nov/22 ]

Author:

{'name': 'Jason Zhang', 'email': 'jason.zhang@mongodb.com', 'username': 'jz1242'}

Message: SERVER-70247 SyncTransactionWithRetries used with SEPTransactionClient can leave transactions open when runNoThrow opCtx gets cancelled
Branch: master
https://github.com/mongodb/mongo/commit/e57a1281ab96e464f5ee023d56ddde834b97597d

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