[DOCS-4468] mongod in STARTUP2 can participate in elections Created: 04/Dec/14  Updated: 16/Nov/17  Resolved: 08/Dec/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.15

Type: Bug Priority: Critical - P2
Reporter: James Wahlin Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years, 10 weeks, 2 days ago

 Description   

Regarding:
http://docs.mongodb.org/manual/reference/replica-states/

TL;DR: mongod members in STARTUP2 can participate in elections soon after state transition.

During the course of an initial sync, mongod is in a state of STARTUP2 for the duration. While it is true that at the time we transition to STARTUP2 mongod can't vote (as RS threads have not been started), we start the RS threads immediately after the transition (https://github.com/mongodb/mongo/blob/r2.6.5/src/mongo/db/repl/rs.cpp#L556) and are eligible to participate and receive elect commands.
Our gate check code when we receive an elect command (https://github.com/mongodb/mongo/blob/r2.6.5/src/mongo/db/repl/consensus.cpp#L223) has no logic to prevent voting in STARTUP2 and only blocks participation for invalid replset name or if our rs config is stale.

All of this makes sense as is beneficial for an initial-syncing node to vote in elections. This allows mongod to maintain primary, even in the case where a majority of members are performing an initial sync.



 Comments   
Comment by Githook User [ 08/Dec/14 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: DOCS-4468 rewrite replica set state docs for 2.6
Branch: master
https://github.com/mongodb/docs/commit/0cf9836f9816338c56071a7d1753ec3006745497

Comment by Eric Milkie [ 04/Dec/14 ]

This page actually needs a few more corrections, for the 2.8 manual. I will put up a CR for it.

Generated at Thu Feb 08 07:48:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.