Database Reference
In-Depth Information
Secondaries apply
oplog
in an asynchronous procedure from the
primary
node.
When the
primary
node of a replica set doesn't send or receive a ping (heartbeat) mes-
sage for 10 seconds with other nodes, the replica set will conduct an election to choose the
primary
node from secondaries. The
secondary
node that has the majority of votes
becomes the primary node. Of course, the
arbiter
node comes in handy in this situ-
ation.
When the old
primary
node comes online again, it will become a new
secondary
node.
The following chart shows you the procedure of the election process and the procedure of
choosing a new
primary
node: