DBAtlas · Database operations atlas

216 ElectionInProgress: ElectionInProgress

MongoDB

What does it mean?

A primary election is currently in progress in the replica set. Until the election completes the primary is undetermined, so writes (and some reads) are temporarily not accepted.

Why does it happen?

The cluster is electing a new primary after the current primary went down, a network partition, a step-down for maintenance, or a node restart. An election usually takes a few seconds; operations arriving within this window hit this condition.

How to fix it

This is transient; enable your driver's retry feature (retryable writes/reads) so the operation is retried automatically once the election finishes. If elections are frequent or long, investigate the root cause: network stability, node health, vote configuration, and election timeout settings (settings.electionTimeoutMillis). Inspect cluster state with rs.status().

Open in DBAtlas →

More from this engine