-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
RE: https://docs.mongodb.org/manual/tutorial/configure-replica-set-secondary-sync-target/#sync-logic
To affect the sync target for the initial sync, run rs.syncFrom() operation before initial sync.
It's that word "before" which isn't really possible. The only way to call rs.syncFrom() is if you have a shell to the affected member. If you have a shell to the affected member then it is contactable by all others members, and is also probably itself hunting for a sync target already. I.E the human must race the machine to change sync targets. That isn't a winnable race.
SERVER-7680 suggests issuing the rs.syncFrom() as normal and then killing the current operations related to initial sync (presumably using db.currentOp()). Which will cause the hunt to recognize the new setting and re-acquire to the desired target.
However, all this only works if you don't have auth enabled because, if you do, the credentials haven't been replicated yet (or you log in as __system).
Alternatively, use iptables or other firewall-type arrangements to force the target to have no choice.
I don't know the best answer in this case, but certainly right now it is not as simple as the docs suggest.
- is related to
-
SERVER-7680 Have replSetSyncFrom restart initialSync/resync with host specified
- Closed