diff --git a/source/administration/replica-sets.txt b/source/administration/replica-sets.txt index 549896860a0..fc3444c7f68 100644 --- a/source/administration/replica-sets.txt +++ b/source/administration/replica-sets.txt @@ -556,6 +556,21 @@ resource requirements and do not require dedicated hardware. rs.addArb("m1.example.net:30000") +.. _replica-set-configure-sync-target: + +Manually Configure a Secondary's Sync Target +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To override the default selection logic, if needed, and manually +configure a :term:`secondary` member's sync target for polling +:term:`oplog` entries, use either of the following: + +- :dbcommand:`replSetSyncFrom` command + +- :method:`rs.syncFrom()` helper in the :program:`mongo` shell + +Always exercise caution when overriding the default behavior. + .. _replica-set-procedure-change-oplog-size: Changing Oplog Size diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 94d986e314c..7ffce04cb8a 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -261,17 +261,17 @@ set members sync, or copy, :term:`oplog` entries from other members. When a new member joins a set or an existing member restarts, the member waits to receive heartbeats from other members. By default, the member syncs from the *the closest* member of the -set that is either the primary or another secondary with more recent -oplog entries. This prevents two secondaries from syncing from each other. +set that is either the primary or another :term:`secondary` with more recent +oplog entries. In version 2.0, secondaries only change sync targets if the connection -between secondaries drops or produces an error. +to the sync target drops or produces an error. For example: #. If you have two secondary members in one data center and a primary in a second facility, and if you start all three instances at roughly - the same time (i.e. with no existing data sets or oplog,) both + the same time (i.e. with no existing data sets or oplog), both secondaries will likely sync from the primary, as neither secondary has more recent oplog entries. @@ -283,4 +283,31 @@ For example: facility, the new secondary will likely sync from the existing secondary because it is closer than the primary. -.. seealso:: :ref:`replica-set-resync-stale-member` +In version 2.0, secondaries also use the following additional sync +behaviors: + +- Secondaries will sync from :ref:`delayed members + ` *only* if no other member is available. + +- Secondaries will *not* sync from :ref:`hidden members + `. + +- Secondaries will *not* start syncing from a member that has become + stale and is in recovering state. For more information on stale + members, see :ref:`replica-set-resync-stale-member`. + +- A secondary will not sync from a member that has no indexes, *unless* + the secondary's :data:`members[n].buildIndexes` field is set to + ``false``. For one member to sync from another, both must have the + same value, either ``true`` or ``false``, for + :data:`members[n].buildIndexes`. + +Indexes +------- + +By default, secondaries will in most cases pre-fetch :ref:`indexes` +associated with a query to improve replication throughput. If needed, +you can disable this feature using the :setting:`replIndexPrefetch` +setting or the :option:`--replIndexPrefetch ` option. Optionally you also can allow the +:program:`mongod` to pre-fetch only the index on the ``_id`` field. diff --git a/source/release-notes/2.2.txt b/source/release-notes/2.2.txt index f1b6f48e3da..ff4c91225ff 100644 --- a/source/release-notes/2.2.txt +++ b/source/release-notes/2.2.txt @@ -665,6 +665,8 @@ identify what process may produce errors or halt replication. See Replica Set Members can Sync from Specific Members `````````````````````````````````````````````````` +.. the following has been copied to source/administration/replica-sets.txt + The new :dbcommand:`replSetSyncFrom` command and new :method:`rs.syncFrom()` helper in the :program:`mongo` shell make it possible for you to manually configure from which member of the set a @@ -676,6 +678,8 @@ behavior. Replica Set Members will not Sync from Members Without Indexes Unless ``buildIndexes: false`` ````````````````````````````````````````````````````````````````````````````````````````````` +.. the following has been copied to source/core/replication-internals.txt + To prevent inconsistency between members of replica sets, if the member of a replica set has :data:`members[n].buildIndexes` set to ``true``, other members of the replica set will *not* sync from this @@ -685,6 +689,8 @@ member, unless they also have :data:`members[n].buildIndexes` set to New Option To Configure Index Pre-Fetching during Replication ````````````````````````````````````````````````````````````` +.. the following has been copied to source/core/replication-internals.txt + By default, when replicating options, :term:`secondaries ` will pre-fetch :ref:`indexes` associated with a query to improve replication throughput in most cases. The :setting:`replIndexPrefetch` setting and