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

Background index behaviour on a secondary

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual
    • Labels:
      None
    • # Replies:
      7
    • Last comment by Customer:
      false

      Description

      It looks like the information on building background indexes on a secondary may be based on an incorrect commit comment for SERVER-2771:
      http://www.mongodb.org/display/DOCS/Building+indexes+with+replica+sets#Buildingindexeswithreplicasets-Version2.1.0andlater

      The comment from Kristina says:

      Index builds will now happen in the background on secondaries if they happen in the background on the primary. This means that reads can continue while the index builds. However, replication will block until the index build is complete.

      .. but the preceding commit actually appears to change the background index on the primary to a foreground index with the log message:

      info: indexing in foreground on this replica; was a background index build on the primary

        Issue Links

          Activity

          Hide
          stennie Stephen Steneker added a comment -
          Show
          stennie Stephen Steneker added a comment - Also mentioned here: http://www.mongodb.org/display/DOCS/Indexing+as+a+Background+Operation
          Hide
          sam.kleinman Sam Kleinman added a comment -

          I've updated the wiki pages to reflect the facts:

          • If you specify background: true when creating the index on the primary, secondaries in 2.1 and 2.2 will build the index in the background. This allows secondary (i.e. slaveOk) reads to continue while building the index.
          • Replication will halt on a secondary while the index is built (in the background.)

          I'm going to update the new docs (which are still in draft status) with this fact shortly, but I think it'd be ok to close this ticket if you're ok with that?

          Show
          sam.kleinman Sam Kleinman added a comment - I've updated the wiki pages to reflect the facts: If you specify background: true when creating the index on the primary, secondaries in 2.1 and 2.2 will build the index in the background. This allows secondary (i.e. slaveOk) reads to continue while building the index. Replication will halt on a secondary while the index is built (in the background.) I'm going to update the new docs (which are still in draft status) with this fact shortly, but I think it'd be ok to close this ticket if you're ok with that?
          Hide
          sam.kleinman Sam Kleinman added a comment -

          Fixed in the commits that resolved DOCS-330

          Show
          sam.kleinman Sam Kleinman added a comment - Fixed in the commits that resolved DOCS-330
          Hide
          pasette Dan Pasette added a comment -

          Sam, the wiki page is still incorrect as stephen pointed out. The fix to allow background:true to be propagated to secondaries did not make it 2.2.0

          Can you fix that where it appears on either the wiki or the new docs?

          Show
          pasette Dan Pasette added a comment - Sam, the wiki page is still incorrect as stephen pointed out. The fix to allow background:true to be propagated to secondaries did not make it 2.2.0 Can you fix that where it appears on either the wiki or the new docs?
          Hide
          pasette Dan Pasette added a comment -

          On a related note, I think we should document SERVER-3067 (can't kill a foreground index operation) on the index page. This is super important since it takes a write lock and prevents reads and writes on that database durin the duration of the index build.

          Show
          pasette Dan Pasette added a comment - On a related note, I think we should document SERVER-3067 (can't kill a foreground index operation) on the index page. This is super important since it takes a write lock and prevents reads and writes on that database durin the duration of the index build.
          Hide
          sam.kleinman Sam Kleinman added a comment -

          The new docs have the new behavior, and will go out today. I've just edited the wiki pages to reflect this change.

          I'm going to make a new docs ticket for can't kill foreground index operation.

          Show
          sam.kleinman Sam Kleinman added a comment - The new docs have the new behavior, and will go out today. I've just edited the wiki pages to reflect this change. I'm going to make a new docs ticket for can't kill foreground index operation.
          Hide
          sam.kleinman Sam Kleinman added a comment -

          new docs pushed, and this point is clarified.

          Show
          sam.kleinman Sam Kleinman added a comment - new docs pushed, and this point is clarified.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                5 years, 6 days ago
                Date of 1st Reply: