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

IndexRebuilder should only restart index builds initiated internally

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 2.5.0
    • Fix Version/s: Backlog
    • Component/s: Indexing, Replication
    • Labels:
      None
    • Operating System:
      ALL

      Description

      It should not restart user-initiated index builds.

      Scenario:
      1) User starts building a unique index on {a:1} on the current primary, node A.
      2) Node A dies suddenly (kill -9 or power failure, etc) and node B becomes the new primary.
      3) Node A restarts and the IndexRebuilder restarts building of the index.

      At this point, node A now has an index that does not exist on the primary and never will. This would be less of a problem for a non-unique index, but because this is unique, an insert can now succeed on the primary but fail on node A, breaking replication.

      I think the right solution is to only rebuild indexes where we would not call logOp on completion.

        Issue Links

          Activity

          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

          Message: SERVER-13951 Split index building in to UnitOfWork-sized stages

          All index builds now go through the MultiIndexBuilder as its API was already
          close to ideal. The following tickets have also been addressed by this commit:

          SERVER-14710 Remove dropDups
          SERVER-12309 Cloner build indexes in parallel
          SERVER-14737 Initial sync uses bg index building
          SERVER-9135 fast index build for initial sync
          SERVER-2747 can't kill index in phase 2
          SERVER-8917 check error code rather than assuming all errors are dups
          SERVER-14820 compact enforces unique while claiming not to
          SERVER-14746 IndexRebuilder should be foreground and fail fatally
          Branch: master
          https://github.com/mongodb/mongo/commit/00913e47de5aced5267e44e82ac9e976bbaac089

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'} Message: SERVER-13951 Split index building in to UnitOfWork-sized stages All index builds now go through the MultiIndexBuilder as its API was already close to ideal. The following tickets have also been addressed by this commit: SERVER-14710 Remove dropDups SERVER-12309 Cloner build indexes in parallel SERVER-14737 Initial sync uses bg index building SERVER-9135 fast index build for initial sync SERVER-2747 can't kill index in phase 2 SERVER-8917 check error code rather than assuming all errors are dups SERVER-14820 compact enforces unique while claiming not to SERVER-14746 IndexRebuilder should be foreground and fail fatally Branch: master https://github.com/mongodb/mongo/commit/00913e47de5aced5267e44e82ac9e976bbaac089
          Hide
          redbeard0531 Mathias Stearn added a comment -

          Would need custom backport.

          Show
          redbeard0531 Mathias Stearn added a comment - Would need custom backport.
          Hide
          redbeard0531 Mathias Stearn added a comment -

          This was accidentally closed instead of SERVER-14765. The work on this hasn't been done yet

          Show
          redbeard0531 Mathias Stearn added a comment - This was accidentally closed instead of SERVER-14765 . The work on this hasn't been done yet

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: