Priority 0 Replica Set Members

A priority 0 member is a member thatcannot become primary and cannot triggerelections. Priority 0 members can acknowledge writeoperations issued with write concern ofw : <number>. For "majority" write concern, the priority 0member must also be a voting member (i.e. members[n].votes isgreater than 0) to acknowledge the write. Non-voting replica setmembers (i.e. members[n].votes is 0) cannot contribute toacknowledging write operations with "majority" write concern.

Other than the aforementioned restrictions, secondaries that havepriority 0 function as normalsecondaries: they maintain a copy of the data set, accept readoperations, and vote in elections.

Configure a secondary to have priority 0 to prevent it frombecoming primary, which is particularly useful in multi-data centerdeployments.

For example, in the following diagram, one data center hosts theprimary and a secondary. A second data center hosts a secondary withpriority 0. Only the members in data center 1 can become primary.

Diagram of a 3 member replica set distributed across two data centers. Replica set includes a priority 0 member.

Priority 0 Members as Standbys

A secondary with priority 0 canfunction as a standby. In some replica sets, it might not be possibleto add a new member in a reasonable amount of time. A standby memberkeeps a current copy of the data to be able to replace an unavailablemember.

In many cases, you need not set standby to priority 0. However, in replicasets with varied hardware or geographic distribution, a priority 0 standbyensures that only certain members become primary.

A priority 0 standby may also be valuable for some members of a setwith different hardware or workload profiles. In these cases, deploy amember with priority 0 so it can’t become primary. Also considerusing an hidden member for thispurpose.

If your set already has seven voting members, also configure themember as non-voting.

Failover Considerations

When configuring a secondary to have priority 0, consider potential failover patterns, includingall possible network partitions. Always ensure that your main datacenter contains both a quorum of voting members and members that areeligible to be primary.

Example

To configure a secondary to have priority 0, seePrevent Secondary from Becoming Primary.