> This page location: /docs.md > /docs/development.md > /docs/manual/replication.md > /docs/manual/reference/replication.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Replica Set Member States

Each member of a replica set has a state.

| Number | Name | State Description |
| --- | --- | --- |
| 0 | [`STARTUP`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP) | Not yet an active member of any set. All members start up in this state. The [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) parses the [replica set configuration document](https://www.mongodb.com/docs/manual/administration/replica-set-member-configuration.md) while in [`STARTUP`.](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP) |
| 1 | [`PRIMARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.PRIMARY) | The member in state [primary](https://www.mongodb.com/docs/manual/core/replica-set-primary.md#std-label-replica-set-primary) is the only member that can accept write operations. Eligible to vote. |
| 2 | [`SECONDARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.SECONDARY) | A member in state [secondary](https://www.mongodb.com/docs/manual/core/replica-set-secondary.md#std-label-replica-set-secondary-members-ref) is replicating the data store. Eligible to vote. |
| 3 | [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) | Members either perform startup self-checks, or transition from completing a [rollback](https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md#std-label-replica-set-rollbacks) or [resync](https://www.mongodb.com/docs/manual/tutorial/resync-replica-set-member.md#std-label-resync-replica-member). Data is not available for reads from this member. Eligible to vote. |
| 5 | [`STARTUP2`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP2) | The member is running an initial sync. Eligible to vote, except when newly added to the replica set. |
| 6 | [`UNKNOWN`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.UNKNOWN) | The member's state, as seen from another member of the set, is not yet known. |
| 7 | [`ARBITER`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ARBITER) | [Arbiters](https://www.mongodb.com/docs/manual/core/replica-set-members.md#std-label-replica-set-arbiters) do not replicate data and exist solely to participate in elections. Eligible to vote. |
| 8 | [`DOWN`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.DOWN) | The member, as seen from another member of the set, is unreachable. |
| 9 | [`ROLLBACK`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ROLLBACK) | This member is actively performing a [rollback](https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md#std-label-replica-set-rollbacks).  Eligible to vote. Data is not available for reads from this member. Starting in version 4.2, MongoDB kills all in-progress user operations when a member enters the [`ROLLBACK`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ROLLBACK) state. |
| 10 | [`REMOVED`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.REMOVED) | This member was once in a replica set but was subsequently removed. |

## States

### Core States

Members in [`PRIMARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.PRIMARY) state accept write operations. A replica set has at most one primary at a time.  A [`SECONDARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.SECONDARY) member becomes primary after an [election](https://www.mongodb.com/docs/manual/core/replica-set-elections.md#std-label-replica-set-elections). Members in the [`PRIMARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.PRIMARY) state are eligible to vote.

Members in [`SECONDARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.SECONDARY) state replicate the primary's data set and can be configured to accept read operations. Secondaries are eligible to vote in elections, and may be elected to the [`PRIMARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.PRIMARY) state if the primary becomes unavailable.

Members in [`ARBITER`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ARBITER) state do not replicate data or accept write operations. They are eligible to vote, and exist solely to break a tie during elections. Replica sets should only have a member in the [`ARBITER`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ARBITER) state if the set would otherwise have an even number of voting members, and could suffer from tied elections. There should only be at most one arbiter configured in any replica set. For considerations when using an arbiter, see [Replica Set Arbiter.](https://www.mongodb.com/docs/manual/core/replica-set-arbiter.md)

See [Replica Set Members](https://www.mongodb.com/docs/manual/core/replica-set-members.md) for more information on core states.

### Other States

Each member of a replica set starts up in [`STARTUP`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP) state. [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) then loads that member's replica set configuration, and transitions the member's state to [`STARTUP2`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP2) or [`ARBITER`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ARBITER). Members in [`STARTUP`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP) are not eligible to vote, as they are not yet a recognized member of any replica set.

**Changed in version 5.0**

Each data-bearing member of a replica set enters the [`STARTUP2`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP2) state as soon as [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) finishes loading that member's configuration.

The member then decides whether or not to undertake an initial sync. If a member begins an initial sync, the member remains in [`STARTUP2`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP2) until all data is copied and all indexes are built. Afterwards, the member transitions to [`RECOVERING`.](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING)

Newly-added members in [`STARTUP2`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP2) are not eligible to vote and cannot be elected during the initial sync process. Prior to MongoDB 5.0, members in [`STARTUP2`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.STARTUP2) were eligible to vote.

A member of a replica set enters [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) state when it is not ready to accept reads. The [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) state can occur during normal operation, and doesn't necessarily reflect an error condition.  Members in the [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) state are eligible to vote in elections, but are not eligible to enter the [`PRIMARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.PRIMARY) state.

A member transitions from [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) to [`SECONDARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.SECONDARY) after replicating enough data to guarantee a consistent view of the data for client reads.  The only difference between [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) and [`SECONDARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.SECONDARY) states is that [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) prohibits client reads and [`SECONDARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.SECONDARY) permits them. [`SECONDARY`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.SECONDARY) state does not guarantee anything about the staleness of the data with respect to the primary.

Due to overload, a [secondary](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-secondary) may fall far enough behind the other members of the replica set such that it may need to [resync](https://www.mongodb.com/docs/manual/tutorial/resync-replica-set-member.md) with the rest of the set. When this happens, the member enters the [`RECOVERING`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.RECOVERING) state and requires manual intervention.

Whenever the replica set replaces a [primary](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-primary) in an election, the old primary may contain documents that did not replicate to the [secondary](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-secondary) members. In this case, the old primary member reverts those writes. During [rollback](https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md#std-label-replica-set-rollbacks), the member will have [`ROLLBACK`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ROLLBACK) state. Members in the [`ROLLBACK`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ROLLBACK) state are eligible to vote in elections.

Starting in version 4.2, MongoDB kills all in-progress user operations when a member enters the [`ROLLBACK`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.ROLLBACK) state.

### Error States

Members in any error state can't vote.

Members that have never communicated status information to the replica set are in the [`UNKNOWN`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.UNKNOWN) state.

Members that lose their connection to the replica set are seen as [`DOWN`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.DOWN) by the remaining members of the set.

Members that are removed from the replica set enter the [`REMOVED`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.REMOVED) state. When members enter the [`REMOVED`](https://www.mongodb.com/docs/manual/reference/replica-states.md#mongodb-replstate-replstate.REMOVED) state, the logs will mark this event with a `replSet REMOVED` message entry.

In [some circumstances](https://www.mongodb.com/docs/manual/core/read-preference-use-cases.md#std-label-edge-cases), two nodes in a replica set may *transiently* believe that they are the primary, but at most, one of them will be able to complete writes with [`{ w: "majority" }`](https://www.mongodb.com/docs/manual/reference/write-concern.md#mongodb-writeconcern-writeconcern.-majority-) write concern. The node that can complete [`{ w: "majority" }`](https://www.mongodb.com/docs/manual/reference/write-concern.md#mongodb-writeconcern-writeconcern.-majority-) writes is the current primary, and the other node is a former primary that has not yet recognized its demotion, typically due to a [network partition](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-network-partition). When this occurs, clients that connect to the former primary may observe stale data despite having requested read preference [`primary`](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-primary), and new writes to the former primary will eventually roll back.
