[SERVER-39776] Initial sync and replication threads simultaneous startup and shutdown races Created: 22/Feb/19 Updated: 29/Oct/23 Resolved: 16/Aug/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.2.1, 4.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Matthew Russotto |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.2
|
||||||||
| Sprint: | Repl 2019-07-15, Repl 2019-07-29, Repl 2019-08-12, Repl 2019-08-26 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 57 | ||||||||
| Description |
|
If a mongod is shut down while it is still starting up (but after its config state is set to steady state), there are at least two races 1) The initial syncer may be created after we would have shut it down. This can be fixed by checking for _inShutdown in the critical section in _startDataReplication where we create the initial syncer; if it is set we should not create the initial syncer. 2) The data replication threads in ReplicationCoordinatorExternalStateImpl may be started after shutdown is called. This can be fixed by both setting _inShutdown to true even if _startedThreads is false in ReplicationCoordinatorExternalStateImpl::shutdown(), and also checking _inShutdown in ReplicationCoordinatorExternalStateImpl::startThreads. |
| Comments |
| Comment by Githook User [ 23/Aug/19 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@10gen.com', 'username': 'mtrussotto'}Message: (cherry picked from commit d362c1c39ca79dd20e0aa6e9f93171fc5bd2cdec) |
| Comment by Githook User [ 23/Aug/19 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@10gen.com', 'username': 'mtrussotto'}Message: (cherry picked from commit 025c02738625a57ff738942b660832b794510fb1) |
| Comment by Githook User [ 16/Aug/19 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@10gen.com', 'username': 'mtrussotto'}Message: |
| Comment by Githook User [ 16/Aug/19 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@10gen.com', 'username': 'mtrussotto'}Message: |
| Comment by Matthew Russotto [ 31/Jul/19 ] |
|
Code Review URL: https://mongodbcr.appspot.com/502410005/ |