[SERVER-8458] adding a node that has been a replset member should clear out the cached state Created: 06/Feb/13 Updated: 03/Mar/15 Resolved: 20/Feb/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | 2.7.8 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | c a morcomb | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
ubuntu |
||
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
I set up a replica set with 3 nodes, one acting as arbiter. after initializing and adding the hosts, I added the third as a arbiter using rs.addArb(host) rs.conf()
"_id" : "api", , , { "_id" : 2, "host" : "minnow-data-arbiter-1.cloud.appcelerator.com:27017", "arbiterOnly" : true }rs.status() "set" : "api", , , { "_id" : 2, "name" : "minnow-data-arbiter-1.cloud.appcelerator.com:27017", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 4882, "lastHeartbeat" : ISODate("2013-02-06T23:51:39Z"), "pingMs" : 12 } ], I would expect the third node to be in state 7 for arbiter. |
| Comments |
| Comment by Eric Milkie [ 20/Feb/15 ] |
|
Fixed as part of the replication refactor for 3.0. A node removed from a set and readded as an arbiter now properly works as an arbiter. |
| Comment by c a morcomb [ 08/Feb/13 ] |
|
Thanks this is what must have happened. Following your steps fixed it. Much thanks. |
| Comment by Thomas Rueckstiess [ 08/Feb/13 ] |
|
Hi, did you add the node as a secondary before, then removed it with rs.remove() and re-added it as an arbiter? This is the only way I can think of that would put you in this situation. If this is the case, you should shut down the arbiter node, delete its dbpath directory (arbiters don't need to store any data on disk) and restart it. The rs.status() then should show the node correctly as ARBITER. Please let us know if this procedure solves your problem or if you have any additional questions. Regards, |
| Comment by c a morcomb [ 07/Feb/13 ] |
|
mongodb 2.2.3 |