11602 InterruptedDueToReplStateChange: Operation interrupted due to a replication state change
MongoDBWhat 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().
More from this engine
- 24 LockTimeoutOperation exceeded time limit waiting for a lock
- 7 HostNotFoundCould not find host
- 175 QueryPlanKilledQuery plan killed during execution
- 136 CappedPositionLostCapped collection position lost
- 28 PathNotViableCannot use the part of the path to traverse the element
- 216 ElectionInProgressElectionInProgress
- 225 TransactionTooOldTransactionTooOld