nerdexam
MongoDB

C100DBA · Question #86

In a replica set, a_________number of members ensures that the replica set is always able to select a primary.

The correct answer is B. Odd. An odd number of members ensures a replica set can always elect a primary because elections require a majority vote (more than half of all voting members). With an odd count like 3, 5, or 7, one side will always have a clear majority even if nodes fail or become partitioned…

Replication

Question

In a replica set, a_________number of members ensures that the replica set is always able to select a primary.

Options

  • AEven
  • BOdd
  • C2

How the community answered

(31 responses)
  • A
    10% (3)
  • B
    87% (27)
  • C
    3% (1)

Explanation

An odd number of members ensures a replica set can always elect a primary because elections require a majority vote (more than half of all voting members). With an odd count like 3, 5, or 7, one side will always have a clear majority even if nodes fail or become partitioned.

Why A (Even) is wrong: An even number of members risks a split-vote scenario - for example, with 4 members, a network partition could create two groups of 2, and neither side can claim a majority, leaving the set without a primary.

Why C (2) is wrong: Two is a specific even number and inherits the same majority problem - if one member fails, the remaining member holds only 1 of 2 votes (50%), which does not meet the majority threshold needed to elect a primary.

Memory tip: Think "odd wins elections" - just like a tiebreaker in voting, an odd number of members guarantees someone always gets the majority, preventing deadlock.

Topics

#replica set#primary election#odd members#voting

Community Discussion

No community discussion yet for this question.

Full C100DBA Practice