Skip to content

Commit bd7a76b

Browse files
author
Andrew Leung
committed
some updates from wiki
1 parent 8142ee4 commit bd7a76b

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

source/core/replication-internals.txt

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ Elections
118118
When you initialize a replica set for the first time, and when any
119119
failover occurs, an election takes place to decide which member should
120120
become :term:`primary`. A primary is the only member in the replica
121-
set that can accept write commands such as :func:`insert`,
122-
:func:`update`, and :func:`delete`.
123-
.. TODO verify above function references.
121+
set that can accept write commands such as :func:`insert()
122+
<db.collection.insert()>`, :func:`update() <db.collection.update()>`,
123+
and :func:`remove() <db.collection.remove`.
124124

125125
Elections are the process replica set members use to
126-
select the primary member in a cluster. Elections follow two events:
127-
a primary member that "steps down" or a :term:`secondary` member that
126+
select the primary in a cluster. Elections follow two events:
127+
a primary that "steps down" or a :term:`secondary` that
128128
loses contact with a :term:`primary` member. All members have one vote
129129
in an election, and every :program:`mongod` can veto an election. A
130-
single member's veto will invalidate the election.
130+
single veto will invalidate the election.
131131

132132
An existing primary will step down in response to the
133133
:dbcommand:`replSetStepDown` command, or if it sees that one of
@@ -143,7 +143,7 @@ In an election, every member, including :ref:`hidden
143143
<replica-set-hidden-members>` members, :ref:`arbiters
144144
<replica-set-arbiters>`, and even recovering members get a single
145145
vote. Members will give votes to every eligible member that calls an
146-
election. A primary is elected when one member receives a majority of the votes in the set.
146+
election.
147147

148148
A member of the set will veto an election under the following
149149
conditions:
@@ -194,6 +194,24 @@ aware of the following conditions and possible situations:
194194
:term:`primary` until the member with the highest priority catches up
195195
to the latest operation.
196196

197+
Each member in a replica set has only one vote, by default. You may
198+
change the number of votes each member has to allow for larger replica
199+
sets. Each replica set is limited to 12 total members with 7 voting
200+
members.
201+
202+
- The number of votes is modifiable in the :data:`replica set configuration <members[n].votes>`
203+
204+
- The number of votes each member has can be any non-negative integer,
205+
but it is highly recommended each member has 1 or 0 votes.
206+
207+
- To select a member to be a "preferred primary", modify the member's
208+
:ref:`priority value <replica-set-node-priority-configuration>`
209+
instead of adjusting the number of votes the member has.
210+
211+
.. TODO verify this. what should one do when >7 members are in a set?
212+
- When there are more than seven members in a replica set, adjust the
213+
number of votes for each active member.
214+
197215
Syncing
198216
-------
199217

0 commit comments

Comments
 (0)