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

Initial sync source is much harder to set than docs suggest

    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            andrew.ryder@mongodb.com Andrew Ryder (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 14 weeks, 1 day ago