diff options
Diffstat (limited to 'src/mongo/s/query/cluster_find.cpp')
-rw-r--r-- | src/mongo/s/query/cluster_find.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
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; } |