Skip to content

DOCS-154 DOCS-816 include in manual the 2.2 replica set behaviors #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions source/administration/replica-sets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 32 additions & 5 deletions source/core/replication-internals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
<replica-set-delayed-members>` *only* if no other member is available.

- Secondaries will *not* sync from :ref:`hidden members
<replica-set-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 <mongod
--replIndexPrefetch>` option. Optionally you also can allow the
:program:`mongod` to pre-fetch only the index on the ``_id`` field.
6 changes: 6 additions & 0 deletions source/release-notes/2.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 <secondary>`
will pre-fetch :ref:`indexes` associated with a query to improve replication
throughput in most cases. The :setting:`replIndexPrefetch` setting and
Expand Down