diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2022-03-31 14:59:07 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-31 16:39:31 +0000 |
commit | 2d78530f2b590d205232bd3d65cb8f66500aa86f (patch) | |
tree | 6f896f05ea6c30a6a4f761ae21dd0e9965342fa0 /src/mongo/db/pipeline/sharded_agg_helpers.cpp | |
parent | e827fca1f586eb49ea1536b2985bd55a0105093b (diff) | |
download | mongo-2d78530f2b590d205232bd3d65cb8f66500aa86f.tar.gz |
SERVER-64872 Ensure `CollectionUUIDMismatch` from sharded `aggregate` does not incorrectly omit the actual collection
Diffstat (limited to 'src/mongo/db/pipeline/sharded_agg_helpers.cpp')
-rw-r--r-- | src/mongo/db/pipeline/sharded_agg_helpers.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/sharded_agg_helpers.cpp b/src/mongo/db/pipeline/sharded_agg_helpers.cpp index e47e5414975..3029d1ee440 100644 --- a/src/mongo/db/pipeline/sharded_agg_helpers.cpp +++ b/src/mongo/db/pipeline/sharded_agg_helpers.cpp @@ -54,6 +54,7 @@ #include "mongo/logv2/log.h" #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/s/cluster_commands_helpers.h" +#include "mongo/s/collection_uuid_mismatch.h" #include "mongo/s/query/cluster_query_knobs_gen.h" #include "mongo/s/query/document_source_merge_cursors.h" #include "mongo/s/query/establish_cursors.h" @@ -1116,6 +1117,9 @@ DispatchShardPipelineResults dispatchShardPipeline( uassert(5858100, *failOnShardedCollection, executionNsRoutingInfo->isSharded()); } throw; + } catch (const ExceptionFor<ErrorCodes::CollectionUUIDMismatch>& ex) { + uassertStatusOK(populateCollectionUUIDMismatch(opCtx, ex.toStatus())); + MONGO_UNREACHABLE_TASSERT(6487201); } // If we thought the collection was sharded and the shard confirmed this, fail if the query // isn't valid on a sharded collection. |