diff options
-rw-r--r-- | src/mongo/client/scanning_replica_set_monitor.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/streamable_replica_set_monitor.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_find.cpp | 13 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/mongo/client/scanning_replica_set_monitor.cpp b/src/mongo/client/scanning_replica_set_monitor.cpp index 7de1e0cf9df..9f9f1313997 100644 --- a/src/mongo/client/scanning_replica_set_monitor.cpp +++ b/src/mongo/client/scanning_replica_set_monitor.cpp @@ -335,7 +335,7 @@ Future<std::vector<HostAndPort>> ScanningReplicaSetMonitor::_getHostsOrRefresh( stdx::lock_guard<Latch> lk(_state->mutex); if (_state->isDropped) { - return Status(ErrorCodes::ReplicaSetMonitorRemoved, + return Status(ErrorCodes::ShutdownInProgress, str::stream() << "ScanningReplicaSetMonitor for set " << getName() << " is removed"); } diff --git a/src/mongo/client/streamable_replica_set_monitor.cpp b/src/mongo/client/streamable_replica_set_monitor.cpp index 566b570fde7..f4757417278 100644 --- a/src/mongo/client/streamable_replica_set_monitor.cpp +++ b/src/mongo/client/streamable_replica_set_monitor.cpp @@ -127,7 +127,7 @@ Status makeUnsatisfiedReadPrefError(const std::string& name, } Status makeReplicaSetMonitorRemovedError(const std::string& name) { - return Status(ErrorCodes::ReplicaSetMonitorRemoved, + return Status(ErrorCodes::ShutdownInProgress, str::stream() << "ReplicaSetMonitor for set " << name << " is removed"); } diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp index e5996e656d3..b0b4b69ad3a 100644 --- a/src/mongo/s/query/cluster_find.cpp +++ b/src/mongo/s/query/cluster_find.cpp @@ -578,10 +578,15 @@ CursorId ClusterFind::runQuery(OperationContext* opCtx, } else if (!ErrorCodes::isStaleShardVersionError(ex.code()) && ex.code() != ErrorCodes::ShardInvalidatedForTargeting && ex.code() != ErrorCodes::ShardNotFound) { - // Errors other than stale metadata or from trying to reach a non existent shard are - // fatal to the operation. Network errors and replication retries happen at the - // level of the AsyncResultsMerger. - ex.addContext("Encountered non-retryable error during query"); + + if (ErrorCodes::isRetriableError(ex.code())) { + ex.addContext("Encountered retryable error during query"); + } else { + // Errors other than stale metadata or from trying to reach a non existent shard + // are fatal to the operation. Network errors and replication retries happen at + // the level of the AsyncResultsMerger. + ex.addContext("Encountered non-retryable error during query"); + } throw; } |