[SERVER-77053] Transaction API shouldn't throw top level errors in runCommand Created: 11/May/23  Updated: 29/Oct/23  Resolved: 15/May/23

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc1

Type: Bug 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
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0
Sprint: Sharding NYC 2023-05-15, Sharding NYC 2023-05-29
Participants:
Linked BF Score: 100

 Description   

The transaction API parses commitTransaction results specially to distinguish between command errors (ie top-level ok:0 errors), write concern errors (ie in the writeConcernError field), and client errors (e.g. errors sending the command itself or in client owned code, like the transaction callback), so it can choose to retry if either the command or write concern error is retryable.

SERVER-69194 added behavior so the API will rethrow any top-level error when running a command, and the API uses itself to run commitTransaction, so if a commit fails with a command error, it will now throw an exception with the command error, which makes the API treat it like a client error, preventing retrying on it. If commit fails with a command error and a write concern error, the exception will also swallow the write concern error, which prevents retrying on it as well.

The API should return the response from running a command unmodified, so the intended error handling logic can take effect.



 Comments   
Comment by Githook User [ 15/May/23 ]

Author:

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

Message: SERVER-77053 Transaction API shouldn't throw top level errors in runCommand

(cherry picked from commit cc09debe1f3eacece6986f8bb5fd3199600e54c6)
Branch: v7.0
https://github.com/mongodb/mongo/commit/fa32b1bda05e08af9ffa444f66863b803f1a7546

Comment by Githook User [ 12/May/23 ]

Author:

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

Message: SERVER-77053 Transaction API shouldn't throw top level errors in runCommand
Branch: master
https://github.com/mongodb/mongo/commit/cc09debe1f3eacece6986f8bb5fd3199600e54c6

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