Skip to content

Arbiter nodes in MongoDB — when to use one, why most production setups shouldn't

An arbiter looks like a cheap third vote, but it changes the durability story of your replica set. Here's when it's defensible and when it isn't.

You inherit a replica set marked PSA — primary, secondary, arbiter. The previous team picked the topology to save on the third VM. It worked for a year. Then the secondary takes a long maintenance window, the primary takes a hardware fault during it, and you wake up to a cluster that is technically up but has lost the only other data-bearing copy of the dataset since the last snapshot. The arbiter voted, the secondary was unreachable, and what you thought was an HA setup turned out to be a single point of failure dressed up as three nodes.

What’s happening

An arbiter is a mongod process that participates in elections — it has a vote — but does not hold any data. The original case for it is cost: you wanted three votes for clean majority on failover but didn’t want to pay for the third data-bearing node, especially in deployments where the dataset is large and disk is the dominant cost. So you ran PSA — Primary, Secondary, Arbiter — instead of PSS.

The problem the arbiter creates, which is invisible on paper, shows up the moment you lose one data-bearing member:

  • Durability collapses to single-copy. If the secondary is the one that fails, the only complete copy of the data is the primary. A failure on the primary in that window means restoring from a snapshot, not failing over.
  • Write concern w:majority blocks indefinitely. Majority of voters is 2-of-3. If one of those two is the arbiter, the arbiter cannot acknowledge writes (it has no data). Majority writes can only complete when both data-bearing members are up — meaning your write durability is now equivalent to a two-node setup, with extra steps.
  • Catchup writes from the rejoining secondary can lag for hours. When the secondary comes back, it has to catch up from the oplog. During that time the cluster is operating with a single up-to-date data copy. If your oplog rolled past where the secondary was when it left, the secondary needs a full resync — that’s hours of cold-syncing during which you have no spare data copy at all.

PSS (three full data-bearing members) avoids all three. PSA is defensible only in narrow cases.

How to verify

Check current topology:

rs.conf().members.forEach(m => print(`${m.host}  votes=${m.votes} priority=${m.priority} arbiterOnly=${m.arbiterOnly}`));
// mongo01.internal:27017  votes=1 priority=1 arbiterOnly=false
// mongo02.internal:27017  votes=1 priority=1 arbiterOnly=false
// mongo03.internal:27017  votes=1 priority=0 arbiterOnly=true

If any member shows arbiterOnly=true, that’s an arbiter. Then check how often you’ve been running at single-data-copy. The oplog window in db.getReplicationInfo() plus historical monitoring of secondary uptime tells you how often the cluster has been one data-bearing node away from a restore-from-snapshot event.

Test w:majority behaviour by writing with the arbiter participating in the majority:

db.test.insertOne({ ping: 1 }, { writeConcern: { w: "majority", wtimeout: 5000 } })

If the secondary is down, this write should block for wtimeout ms and fail with MongoWriteConcernError. That’s the symptom — production traffic experiences this as elevated write latencies and intermittent failures during a degraded window.

The fix

The defensible cases for an arbiter are narrow:

  • Geo-distributed three-site deployments where the third site is a network-only tiebreaker (not a data center where you’d put a full replica). Even here, a hidden replica is usually a better answer.
  • PSSA (four-member) setups where two full secondaries plus an arbiter provide an odd vote count without compromising durability. This is the only PSA-adjacent pattern we’d run in production.

For everything else, move to PSS. The operational sequence to convert a PSA to PSS is:

// Add a third data-bearing member
rs.add({ host: "mongo03.internal:27017", priority: 1, votes: 1 });

// Wait until the new member is SECONDARY and oplog-caught-up
// rs.status() should show stateStr SECONDARY and 0 lag

// Remove the arbiter
rs.remove("arbiter01.internal:27017");

// Confirm the new config
rs.conf().members

Do this when the cluster is healthy, not during an incident. The new member will pull a full initial sync from one of the existing data-bearing members — that sync is bandwidth-intensive and will saturate the donor’s I/O. Schedule it for a low-traffic window and watch the donor’s wt cache pressure and disk queue during the sync.

For the rare workload where a third VM is genuinely cost-prohibitive, consider a managed PaaS Mongo offering instead — the per-node cost of a managed replica set is generally lower than self-hosting plus the operational overhead of running with degraded durability.

Stack Harbor runs Mongo replica sets on PSS topologies by default with replication-lag and oplog-window alerts on our monitoring plane under Managed Cloud Ops. If your current topology has an arbiter you’re not sure about, book a topology review.