[SERVER-38746] Provide reason for transaction abort Created: 21/Dec/18 Updated: 29/Oct/23 Resolved: 15/Feb/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.7, 4.1.9 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Oleg Pudeyev (Inactive) | Assignee: | Tess Avitabile (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Backport Requested: |
v4.0
|
||||||||||||
| Sprint: | Repl 2019-02-25 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
While implementing convenient API for transactions spec, I ran into an unhelpful error from the server. The command sent was commitTransaction, and the result was "Transaction X has been aborted", as follows:
In other words, the driver requested that a transaction be committed, and the server replied saying transaction was aborted, but did not say why. Examining the code in the server which returned this string yielded the following:
In other words, the server chose to abort the transaction when a commit was requested because a prior operation in the transaction failed. The server should specify that this was the reason for transaction abort in the returned response, for instance the following message would be much more helpful:
Or, perhaps:
|
| Comments |
| Comment by Githook User [ 22/Feb/19 ] |
|
Author: {'name': 'Tess Avitabile', 'username': 'tessavitabile', 'email': 'tess.avitabile@mongodb.com'}Message: (cherry picked from commit 6c28401a87f1a4a950b2b8cea6b58ef475fb7b4b) |
| Comment by Githook User [ 15/Feb/19 ] |
|
Author: {'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}Message: |
| Comment by Oleg Pudeyev (Inactive) [ 22/Jan/19 ] |
|
The change in error message that transaction is being aborted due to an earlier error is sufficient, without tracking the error code of the original error. |