[SERVER-56772] Validator BSON is lost if write conflict occurs during collMod Created: 07/May/21  Updated: 29/Oct/23  Resolved: 10/May/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.7, 5.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.9, v4.4
Participants:
Linked BF Score: 169

 Description   

When collMod'ing a new validator/validationAction, the original validator BSON is std::move'd to update the durable catalog. If a write conflict happens after this, the collMod will retry however the BSON becomes empty and thus checks like this one will not get hit since we early return if the validator object is empty.



 Comments   
Comment by Githook User [ 20/May/21 ]

Author:

{'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-56772 Do not std::move validator BSON in collMod in case a write conflict is thrown

(cherry picked from commit 4a5a29bad42924fb5de2eba5a17b6f8c2fb435ee)
Branch: v4.4
https://github.com/mongodb/mongo/commit/b80a196d06607d035948ff6ee86f36c7956dafd5

Comment by Githook User [ 07/May/21 ]

Author:

{'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-56772 Do not std::move validator BSON in collMod in case a write conflict is thrown
Branch: master
https://github.com/mongodb/mongo/commit/4a5a29bad42924fb5de2eba5a17b6f8c2fb435ee

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