Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-6664

Initial sync source is much harder to set than docs suggest



    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual, Server
    • Labels:


      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.


          Issue Links



              • Assignee:
                kay.kim Kay Kim
                andrew.ryder Andrew Ryder
                Last commenter:
                Kay Kim
              • Votes:
                2 Vote for this issue
                1 Start watching this issue


                • Created:
                  Days since reply:
                  3 years, 38 weeks, 6 days ago