[SERVER-27694] Uncertain behavior after rs.remove() Created: 16/Jan/17 Updated: 15/Nov/21 Resolved: 07/Apr/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | 3.2.11 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Zhang Youdong | Assignee: | Mark Agarunov |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Suppose a replica set has node1:27017(primary), node2:27017(secondary) case1: when secondary restart,secondary will be in state "could not find member to sync from", it cannot choose a sync source because no data need sync.
case2: after write some data to primary, the secondary will choose a sync source successfully.
rs.remove("node2:27017") behave differently in the above two cases. case1: node2 transition to REMOVED state, and cannot find a sync source. So what's the expected behavior when a node is removed from replica set? |
| Comments |
| Comment by Zhang Youdong [ 07/Feb/17 ] | ||||||||||||||||||||||||||||||||||||||||||
|
The problem is 『when the node in REMOVED state, it still sync data from PRIMARY 』, you can create a new database on PRIMARY, and you can see the new database on the removed node. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Agarunov [ 03/Feb/17 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Hello zyd_com, Unfortunately we've been unable to reproduce the behavior you've described. After removing the node without shutting it down first, the output I am seeing is: Secondary:
Primary:
The output is consistent both before and after restarts, as well as before and after inserting documents on the primary. As mentioned in the documentation, using db.shutdownServer() to shut down the node before removing it is the supported procedure, and as you mentioned, does not exhibit this behavior. Thanks, | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Zhang Youdong [ 19/Jan/17 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Thanks for your reply! There is no problem if shutdown the node frist, but if execute rs.remove() without shutdown the node removed, the removed node will continue to sync data from primary,so I want to know what's the expected behaivor by design? the removed node keeping sync data or the sync will stop? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Agarunov [ 17/Jan/17 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Hello zyd_com, Thank you for your report. To better assist you, I'd like to clarify a couple things. Is the secondary being shut down before removal with db.shutdownServer()? Do you still see this behavior if the node is removed by following the procedure detailed at https://docs.mongodb.com/manual/tutorial/remove-replica-set-member/ ? Additionally, please provide the exact steps and commands used to reproduce this behavior if possible. Thanks, |