[SERVER-8416] Make replica set state changes take a write lock Created: 30/Jan/13 Updated: 11/Jul/16 Resolved: 13/Feb/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | 2.2.4, 2.4.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kristina Chodorow (Inactive) | Assignee: | Kristina Chodorow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
tryToGoLiveAsASecondary needs to take a write lock. Otherwise, we could become primary between lines 562 and 590 of rs_sync.cpp and then immediately become a secondary, not closing connections if anyone is syncing from us (which they may have been simply doing already through chained replication). |
| Comments |
| Comment by auto [ 21/Feb/13 ] |
|
Author: {u'date': u'2013-02-13T16:26:04Z', u'name': u'Kristina', u'email': u'kristina@10gen.com'}Message: |
| Comment by Kristina Chodorow (Inactive) [ 13/Feb/13 ] |
|
To be continued on |
| Comment by auto [ 13/Feb/13 ] |
|
Author: {u'date': u'2013-02-13T16:26:04Z', u'name': u'Kristina', u'email': u'kristina@10gen.com'}Message: |
| Comment by Kristina Chodorow (Inactive) [ 01/Feb/13 ] |
|
Changing this from just "stepping down" to all state changes: anywhere where we check state and then change that, we could have another thread jump in and change the current state between the check and the change. Not sure if there are many of these places, but we should check the code for them. |