Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20973

Initial sync during index drop can cause loss on new member

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.6.11, 3.0.7
    • Component/s: Querying
    • None
    • ALL
    • Hide

      1) Build MongoDB 3.0.7 with attached "mongod3-0-7.patch" applied. This patch forces mongoD queries to yield frequently and adds a 100ms sleep during the yield, making this issue easier to reproduce.
      2) Run the attached reproduction script via mongo shell:

      mongo --nodb repro.js
      
      Show
      1) Build MongoDB 3.0.7 with attached "mongod3-0-7.patch" applied. This patch forces mongoD queries to yield frequently and adds a 100ms sleep during the yield, making this issue easier to reproduce. 2) Run the attached reproduction script via mongo shell: mongo --nodb repro.js

      During the initial sync process mongod will clone data from it's sync source via a getMore() operation. It is possible for this getMore to end early for a given collection on cursor invalidation, having returned only a partial data set. This results in a new replica member with an incomplete data set.

      To trigger this issue the following must occur:
      1) The cloner's getMore() is currently in progress on the sync source, in a yielded state
      2) An index on the collection being cloned is dropped (either directly or due to a failed index build, one example being a unique index build that hits a duplicate key)

      This does not appear to be an issue under 3.2.0-rc0.

        1. mongod3-0-7.patch
          1 kB
        2. repro.js
          2 kB

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: