Skip to content

DOCS-7619: Add notes about how priorities affect elections #2631

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 4 commits 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: 9 additions & 6 deletions source/core/replica-set-elections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ Member Priority

After a replica set has a stable primary, the election algorithm will
make a "best-effort" attempt to have the secondary with the highest
:rsconf:`~members[n].priority` available call an election. Higher
priority secondaries call elections relatively sooner than lower
priority secondaries; however, a lower priority node can still be
elected as primary for brief periods of time, even if a higher priority
secondary is available. Replica set members will continue to call
elections until the highest priority available member becomes primary.
:rsconf:`~members[n].priority` available call an election.
Member priority affects both the timing and the
outcome of elections; secondaries with higher priority call elections
relatively sooner than secondaries with lower
priority, and are also more likely to win. However, a lower priority
instance can be elected as primary for brief periods, even if a higher
priority secondary is available. Replica set members continue
to call elections until the highest priority member available becomes
primary.

Members with a priority value of ``0`` cannot become primary and do
not seek election. For details, see
Expand Down
32 changes: 16 additions & 16 deletions source/tutorial/adjust-replica-set-member-priority.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ Adjust Priority for Replica Set Member
Overview
--------

The priority settings of replica set members affect the outcomes
of :doc:`elections </core/replica-set-elections>` for primary. Use this
setting to ensure that some members are more likely to become primary and
that others can never become primary.
The ``priority`` settings of replica set members affect both the timing
and the outcome of :doc:`elections </core/replica-set-elections>` for
primary. Higher-priority members are more likely to call elections, and
are more likely to win. Use this setting to ensure that some members are
more likely to become primary and that others can never become primary.

The value of the member's
:rsconf:`members[n].priority` setting determines the
member's priority in elections. The higher the number, the higher the
priority.
:rsconf:`~members[n].priority` setting determines the
member's :rsconf:`~members[n].priority` in elections. The higher the number,
the higher the priority.

Considerations
--------------
Expand All @@ -32,24 +33,23 @@ array in the replica configuration object. The array index begins with
set member's :rsconf:`members[n]._id` field in the
array.

The value of :rsconf:`members[n].priority` can be any
The value of :rsconf:`~members[n].priority` can be any
floating point (i.e. decimal) number between ``0`` and ``1000``. The
default value for the :rsconf:`members[n].priority`
field is ``1``.
default value for the ``priority`` field is ``1``.

To block a member from seeking election as primary, assign it a priority
of ``0``. :ref:`Hidden members <replica-set-hidden-members>` and
:ref:`delayed members <replica-set-delayed-members>` have
:rsconf:`members[n].priority` set to ``0``.
``priority`` set to ``0``.

For :doc:`arbiters </core/replica-set-arbiter>`, the default
:rsconf:`members[n].priority` value is ``1``; however, arbiters cannot
``priority`` value is ``1``; however, arbiters cannot
become primary regardless of the configured value.

Adjust priority during a scheduled maintenance window. Reconfiguring
priority can force the current primary to step down, leading to an
election. Before an election the primary closes all open :term:`client`
connections.
Adjust priority settings during a scheduled maintenance window.
Reconfiguring priority can force the current primary to step down,
leading to an election. Before an election, the primary closes all open
:term:`client` connections.

Procedure
---------
Expand Down