[SERVER-2869] rs.stepDown() should fail if slave is far behind and also allow 'force' option Created: 30/Mar/11 Updated: 12/Jul/16 Resolved: 05/Apr/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.8.0 |
| Fix Version/s: | 1.9.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kyle Banker | Assignee: | Kristina Chodorow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
When a user calls rs.stepDown(): 1. If then closest secondary is more than 10 seconds behind the primary, then the stepDown() should be automatically rejected. This is to prevent the situation where the secondary catches up and then the original primary is re-elected. (Many users have experienced this phenomenon, and it doesn't jibe with the idea of a stepDown().) 2. If the stepDown() is rejected, the users should have the option for say rs.stepDown( {force: 1}), which will stop writes to the primary, wait for the secondary to catch up, and then step down the primary so that the secondary does in fact become primary. |
| Comments |
| Comment by auto [ 05/Apr/11 ] |
|
Author: {u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'}Message: stepdown is rejected if other nodes are not up-to-date add force : true option to force stepdown |
| Comment by Kristina Chodorow (Inactive) [ 31/Mar/11 ] |
|
I don't think having a "force" option would work correctly, I think that I think that stepDown should have a longer time that it forces a node to be secondary (maybe 5 minutes instead of 30 seconds). However, once priorities are committed, I don't see this command being used much. Also, there are some practical problems: what would force:1 do if there is no secondary that could become primary? What if there is a secondary but it never catches up (it could have an error and stop syncing)? Then we'd need another command to un-step-down, too. |