diff options
author | Faustoleyva54 <fausto.leyva@mongodb.com> | 2022-02-07 14:28:35 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-07 16:53:18 +0000 |
commit | 59e19dc9bff797fc1cff45d56942e5e61da36f1a (patch) | |
tree | 086234ff19df114172cc18a3811ef05d23154e65 /src/mongo/db/s/refine_collection_shard_key_coordinator.cpp | |
parent | c99e4833db76bba9842cf9ee9add83aaba0c340a (diff) | |
download | mongo-59e19dc9bff797fc1cff45d56942e5e61da36f1a.tar.gz |
SERVER-62453 Add collectionUUID parameter to refineCollectionShardKey command
Diffstat (limited to 'src/mongo/db/s/refine_collection_shard_key_coordinator.cpp')
-rw-r--r-- | src/mongo/db/s/refine_collection_shard_key_coordinator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp b/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp index e4f7b101cdd..45ab58a3889 100644 --- a/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp +++ b/src/mongo/db/s/refine_collection_shard_key_coordinator.cpp @@ -31,7 +31,9 @@ #include "mongo/db/s/refine_collection_shard_key_coordinator.h" +#include "mongo/db/catalog/collection_uuid_mismatch.h" #include "mongo/db/commands.h" +#include "mongo/db/db_raii.h" #include "mongo/db/s/dist_lock_manager.h" #include "mongo/db/s/sharding_ddl_util.h" #include "mongo/logv2/log.h" @@ -134,6 +136,11 @@ ExecutorFuture<void> RefineCollectionShardKeyCoordinator::_runImpl( sharding_ddl_util::stopMigrations(opCtx, nss(), boost::none); } + { + AutoGetCollection coll{opCtx, nss(), MODE_IS}; + checkCollectionUUIDMismatch(opCtx, *coll, _doc.getCollectionUUID()); + } + const auto cmdResponse = uassertStatusOK(configShard->runCommand( opCtx, ReadPreferenceSetting(ReadPreference::PrimaryOnly), |