[SERVER-34055] Convert WriteConflictException error to TransactionAborted Created: 21/Mar/18  Updated: 30/Mar/18  Resolved: 29/Mar/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Siyuan Zhou
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-33432 Implicit transaction abort Closed
related to SERVER-34176 Decide on public name of WriteConflic... Closed
Sprint: Repl 2018-04-09
Participants:

 Comments   
Comment by Siyuan Zhou [ 29/Mar/18 ]

We decided not to convert WriteConflictException into TransactionAborted to expose the original reason of the errors. Closing this as "Won't Fix". SERVER-33432 tracks other implicit transaction abort issues.

Comment by Spencer Brody (Inactive) [ 24/Mar/18 ]

Yes please!

Edit: I see you may be asking about my previous comment about returning TransactionAborted after an abortTransaction command. What I meant was that the abortTransaction command should return OK, but if you try to use the transaction after that you may get a TransactionAborted. That probably won't be until 4.2 though. In 4.0 you'll more likely get TransactionFailed or NoSuchTransaction

Comment by Siyuan Zhou [ 23/Mar/18 ]

Shall we return { ok : 1 } after a transaction was explicitly aborted via the abortTransaction command?

Comment by Spencer Brody (Inactive) [ 23/Mar/18 ]

I believe the only times we'll return TransactionAborted is on WriteConflictException and after a transaction was explicitly aborted via the abortTransaction command.

All other failures will return their specific error codes. Some of those errors might result in the transaction implicitly aborting, while others might leave the transaction around.

Comment by Bruce Lucas (Inactive) [ 22/Mar/18 ]

Will the information about why the transaction was aborted be available to the app in some way?

Comment by Andy Schwerin [ 21/Mar/18 ]

I think converting WCE makes sense. It's the NotMaster-type error codes I was surprised by.

Comment by Siyuan Zhou [ 21/Mar/18 ]

schwerin, my plan for SERVER-33432 includes this conversion. If we don't, users will get WriteConflictException instead and have no idea of the state of transaction.

Comment by Andy Schwerin [ 21/Mar/18 ]

We've had trouble in the past with unintended consequences of error code conversion. We don't do this for retryable writes, and that was a conscious decision. Could we instead just extend the retryable error codes list used by drivers for retryable writes?

Generated at Thu Feb 08 04:35:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.