[SERVER-66998] Do not allow WriteConflict exceptions to be thrown without context Created: 03/Jun/22  Updated: 29/Oct/23  Resolved: 19/Aug/22

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

Type: Improvement Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Fausto Leyva (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-08-22
Participants:
Linked BF Score: 36

 Description   

The utility to throw WriteConflictException allows exceptions to be thrown without context. This makes it very difficult to diagnose errors that get returned to users (or JS tests in our case).

We should remove the defaulted empty context from throwWriteConflictException and fill-in the ~30 places which currently use it with some more useful context.

Also, the message "WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction." is a bit redundant and should perhaps be reworded like this:

str::stream() << "WriteConflict occurred due to " << context << ". Please retry your operation or multi-document transaction."



 Comments   
Comment by Githook User [ 18/Aug/22 ]

Author:

{'name': 'Faustoleyva54', 'email': 'fausto.leyva@mongodb.com', 'username': 'Faustoleyva54'}

Message: SERVER-66998 Do not allow WriteConflict exceptions to be thrown without context
Branch: master
https://github.com/mongodb/mongo/commit/6092b42d5c563e70cc7b5653716ecbb2dc4b5d50

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