[SERVER-77628] Fix locking around FCBIS and storageGlobalParams.dbPath Created: 31/May/23  Updated: 05/Jun/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Trivial - P5
Reporter: Matthew Russotto Assignee: Backlog - Replication Team
Resolution: Unresolved Votes: 0
Labels: former-quick-wins
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-77629 Prevent race between DiskSpaceMonitor... Closed
Assigned Teams:
Replication
Participants:
Linked BF Score: 134

 Description   

File Copy Based Initial Sync currently changes storageGlobalParams.dbPath while holding a global X lock. This parameter is normally read without locking, so it can be read while it is being written resulting in a data race. We should fix this, either by

1) Having FCBIS not change storageGlobalParams.dbPath

2) Outside server startup, requiring any global lock to be held while accessing storageGlobalParams.dbPath and formalizing that with an accessor requiring an opCtx.

3) Locking around it specifically or making it a pointer and using an atomic swap to set it.


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