[SERVER-70634] Add protection to _implicitDefaultWriteConcernMajority Created: 17/Oct/22  Updated: 29/Oct/23  Resolved: 03/Jan/23

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

Type: Bug Priority: Major - P3
Reporter: Vishnu Kaushik Assignee: Lingzhi Deng
Resolution: Fixed Votes: 0
Labels: repl-shortlist, tsan
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.1, v6.0, v5.0
Sprint: Repl 2022-12-26
Participants:
Linked BF Score: 11

 Description   

It is possible for a race on _implicitDefaultWriteConcernMajority to occur between the replication coordinator, which is setting the read / write concern settings on start up etc. and the GetDefaultRWConcernCommand command.

We should prevent this race by protecting that variable with a mutex. See my comment for more info.



 Comments   
Comment by Githook User [ 16/Dec/22 ]

Author:

{'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}

Message: SERVER-70634: Fix data race in _implicitDefaultWriteConcernMajority
Branch: master
https://github.com/mongodb/mongo/commit/c201da20671a73b78593ff4cf9b21fa04973004c

Comment by Vishnu Kaushik [ 17/Oct/22 ]

Requesting a backport up to 5.0 - I don't see this variable in 4.4.

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