[SERVER-37987] Use finer grained locks for on step up reads and writes Created: 07/Nov/18  Updated: 29/Oct/23  Resolved: 13/Nov/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.1.6

Type: Task Priority: Major - P3
Reporter: Judah Schvimer Assignee: Judah Schvimer
Resolution: Fixed Votes: 0
Labels: prepare_durability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-37988 recover locks on step up at the begin... Closed
is depended on by SERVER-37381 Allow prepared transactions to surviv... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-11-19
Participants:

 Description   

Currently we do many reads and writes on step up to write to the oplog, drop temporary collections, and initialize sharding state. These are guarded by the GlobalLock in mode X but to remove that lock we need these reads and writes to take their own locks.



 Comments   
Comment by Judah Schvimer [ 13/Nov/18 ]

These are the only new locks that need to be taken. I audited every other caller in the "on step up" hook and believe that they all take their own locks or use DBDirectClient which takes its own locks.

Comment by Githook User [ 13/Nov/18 ]

Author:

{'name': 'Judah Schvimer', 'email': 'judah@mongodb.com', 'username': 'judahschvimer'}

Message: SERVER-37987 acquire correct locks when dropping temp collections on step up
Branch: master
https://github.com/mongodb/mongo/commit/1a2e677310e647e9cb3781f1cc904f86c41c5b12

Comment by Githook User [ 13/Nov/18 ]

Author:

{'name': 'Judah Schvimer', 'email': 'judah@mongodb.com', 'username': 'judahschvimer'}

Message: SERVER-37987 acquire global IX lock for step-up oplog write
Branch: master
https://github.com/mongodb/mongo/commit/e606e00f3a4b7e88f7e84c4497f39dea32e65049

Generated at Thu Feb 08 04:47:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.