[SERVER-34758] replSetGetStatus can deadlock with initialSyncer Created: 30/Apr/18 Updated: 29/Oct/23 Resolved: 13/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.16, 3.6.6, 4.0.1, 4.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Suganthi Mani |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | initialSync | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Backport Requested: |
v4.0, v3.6, v3.4
|
||||||||||||||||||||
| Sprint: | Repl 2018-06-18 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||
| Description |
|
When called with initialSync:1, replSetGetStatus locks the ReplicationCoordinatorImpl mutex, then the InitialSyncer mutex. The InitialSyncer in the course of normal operation will acquire the same locks in the opposite order. Result: deadlock. I do not think it is necessary to hold the ReplicationCoordinatorImpl mutex while getting the initialSync status, so the fix may be as simple as getting the initialSync status before acquiring the mutex.
|
| Comments |
| Comment by Githook User [ 09/Jul/18 ] |
|
Author: {'username': 'smani87', 'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com'}Message: (cherry picked from commit 3c6d6969752ad4322594dab171ca7dd26b854bc8) |
| Comment by Githook User [ 15/Jun/18 ] |
|
Author: {'username': 'smani87', 'name': 'smani87', 'email': 'suganthi.mani@mongodb.com'}Message: (cherry picked from commit 3c6d6969752ad4322594dab171ca7dd26b854bc8) |
| Comment by Githook User [ 15/Jun/18 ] |
|
Author: {'username': 'smani87', 'name': 'smani87', 'email': 'suganthi.mani@mongodb.com'}Message: (cherry picked from commit 3c6d6969752ad4322594dab171ca7dd26b854bc8) |
| Comment by Githook User [ 13/Jun/18 ] |
|
Author: {'username': 'smani87', 'name': 'smani87', 'email': 'suganthi.mani@mongodb.com'}Message: |