Skip to content

Commit

Permalink
DOCS-1563 adding note about background index construction on secondaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Kleinman committed Oct 23, 2013
1 parent d4353a0 commit 50529c6
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions source/core/index-creation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,28 @@ application code, during designated maintenance windows.
Building Indexes on Secondaries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionchanged:: 2.5.0
Secondary members can now build indexes in the
background. Previously all index builds on secondaries were in the
foreground.

Background index operations on a :term:`replica set`
:term:`primary` become foreground indexing operations on
:term:`secondary members <secondary>` of the set. All indexing
operations on secondaries block replication.
:term:`secondaries <secondary>` begin after the :term:`primary`
completes building the index. If MongoDB builds an index in the
background on the primary, the secondaries will then build that index
in the background.

To build large indexes on secondaries the best approach is to
restart one secondary at a time in :term:`standalone` mode and build the
index. After building the index, restart as a member of the
replica set, allow it to catch up with the other members of the
set, and then build the index on the next secondary. When all the
secondaries have the new index, step down the primary, restart it
as a standalone, and build the index on the former primary.

Remember, the amount of time required to build the index on a
secondary must be within the window of the :term:`oplog`, so
that the secondary can catch up with the primary.
restart one secondary at a time in :term:`standalone` mode and build
the index. After building the index, restart as a member of the
replica set, allow it to catch up with the other members of the set,
and then build the index on the next secondary. When all the
secondaries have the new index, step down the primary, restart it as a
standalone, and build the index on the former primary.

The amount of time required to build the index on a secondary must be
within the window of the :term:`oplog`, so that the secondary can
catch up with the primary.

Indexes on secondary members in "recovering" mode are always built in
the foreground to allow them to catch up as soon as possible.
Expand Down

0 comments on commit 50529c6

Please sign in to comment.