DBAtlas · Database operations atlas

11602 InterruptedDueToReplStateChange: Operation interrupted due to a replication state change

MongoDB

What does it mean?

The operation was interrupted because the replica set state changed (e.g. the primary changed). The in-progress command was terminated because it could not complete safely in the new topology.

Why does it happen?

In-flight operations are interrupted during an election, a primary stepdown, member role changes or a configuration change. It has the same root as 189 PrimarySteppedDown and usually appears at failover time.

How to fix it

This is a retryable error; with retryable writes/reads enabled in the driver, the operation can be retried against the new primary. Catch this error in the application and retry. If it recurs frequently, investigate the cause of the elections: network instability, heartbeat timeouts, overload or oplog lag. Monitor replica set health with rs.status().

Open in DBAtlas →

More from this engine