[SERVER-54284] ExceptionFor<ErrorCodes::WriteConflict> should resolve to WriteConflictException Created: 04/Feb/21  Updated: 29/Oct/23  Resolved: 28/Apr/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 5.0.14, 6.1.0-rc0, 6.0.5

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 1
Labels: mathias-sa-triage, servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Gantt Dependency
has to be done before SERVER-65996 Remove TODOs referencing SERVER-54284 Closed
Related
related to SERVER-57476 Operation may block on prepare confli... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.0, v5.0, v4.4, v4.2
Sprint: Service Arch 2022-04-18, Service Arch 2022-05-02, Service Arch 2022-05-16
Participants:

 Description   

Right now they are separate types which means that we don't round-trip through Status correctly. This seems like a bug waiting to happen. This can be done by partially specializing ExceptionForDispatcher<ErrorCodes::WriteConflict, CategoryList<categories...>> at https://github.com/mongodb/mongo/blob/c61595630908224faa65856222ae7186b72e54cf/src/mongo/util/assert_util.h#L202-L207.



 Comments   
Comment by Githook User [ 19/Jan/23 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-54284 ExceptionFor<ErrorCodes::WriteConflict> should resolve to WriteConflictException

(cherry picked from commit 4fee73e53ecdbfff73d644dd743b66d5e16a1836)
Branch: v6.0
https://github.com/mongodb/mongo/commit/2599afe324597e6df8c1b1e0e8dcafd3c5a7ad9b

Comment by Githook User [ 19/Jan/23 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-54284 Fix resolution for `ExceptionFor<ErrorCodes::WriteConflict>`

(cherry picked from commit ade105650ddf077e095f24455204be7b035d1620)
Branch: v6.0
https://github.com/10gen/mongo-enterprise-modules/commit/f44c2b04ebef8614ad1880eb1aa22fe915dd144b

Comment by Githook User [ 25/Oct/22 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-54284 ExceptionFor<ErrorCodes::WriteConflict> should resolve to WriteConflictException
Branch: v5.0
https://github.com/mongodb/mongo/commit/70b0cf6c18648eb6babcae89dbedd05a1b5182e4

Comment by Githook User [ 25/Oct/22 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-54284 Fix resolution for `ExceptionFor<ErrorCodes::WriteConflict>`

(cherry picked from commit ade105650ddf077e095f24455204be7b035d1620)
Branch: v5.0
https://github.com/10gen/mongo-enterprise-modules/commit/970e961fc5bac4b691c270e83de35bd12c5958aa

Comment by Githook User [ 05/Jul/22 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-65996 Remove TODOs referencing SERVER-54284
Branch: master
https://github.com/mongodb/mongo/commit/2254719a6517cfec00202625bb594db6da889e54

Comment by Githook User [ 28/Apr/22 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-54284 ExceptionFor<ErrorCodes::WriteConflict> should resolve to WriteConflictException
Branch: master
https://github.com/mongodb/mongo/commit/4fee73e53ecdbfff73d644dd743b66d5e16a1836

Comment by Githook User [ 28/Apr/22 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-54284 Fix resolution for `ExceptionFor<ErrorCodes::WriteConflict>`
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/ade105650ddf077e095f24455204be7b035d1620

Comment by Daniel Gottlieb (Inactive) [ 09/Jun/21 ]

This seems like a bug waiting to happen.

Voting for this and linked to SERVER-57476 as the bug did happen. But thankfully caught before it got pushed into production.

Comment by Mathias Stearn [ 04/Feb/21 ]

PS, while you're in there, it would be a great time to do this C++17 TODO to make ExceptionFor<ErrorCategory::Foo> work https://github.com/mongodb/mongo/blob/c61595630908224faa65856222ae7186b72e54cf/src/mongo/util/assert_util.h#L218-L220

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