diff options
author | Enrico Golfieri <enrico.golfieri@mongodb.com> | 2022-10-28 08:31:58 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-28 09:09:09 +0000 |
commit | 22afc187e2a5ed450cf608458393830eb40b913a (patch) | |
tree | 6022e25c67ad9e52aefb1fdea612a4815c569f5b /src/mongo/db/s/create_collection_coordinator.cpp | |
parent | 9ef93f783419da5734d3afdf84e987ed39a1591f (diff) | |
download | mongo-22afc187e2a5ed450cf608458393830eb40b913a.tar.gz |
SERVER-69603 Do not report drop events as part of shardCollection
Diffstat (limited to 'src/mongo/db/s/create_collection_coordinator.cpp')
-rw-r--r-- | src/mongo/db/s/create_collection_coordinator.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp index 7eb8f9cff2e..73ea88abc94 100644 --- a/src/mongo/db/s/create_collection_coordinator.cpp +++ b/src/mongo/db/s/create_collection_coordinator.cpp @@ -66,6 +66,7 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kSharding +MONGO_FAIL_POINT_DEFINE(failAtCommitCreateCollectionCoordinator); namespace mongo { @@ -415,8 +416,8 @@ void broadcastDropCollection(OperationContext* opCtx, const NamespaceString& nss, const std::shared_ptr<executor::TaskExecutor>& executor, const OperationSessionInfo& osi) { - const auto primaryShardId = ShardingState::get(opCtx)->shardId(); const ShardsvrDropCollectionParticipant dropCollectionParticipant(nss); + const auto primaryShardId = ShardingState::get(opCtx)->shardId(); auto participants = Grid::get(opCtx)->shardRegistry()->getAllShardIds(opCtx); // Remove primary shard from participants @@ -424,7 +425,7 @@ void broadcastDropCollection(OperationContext* opCtx, participants.end()); sharding_ddl_util::sendDropCollectionParticipantCommandToShards( - opCtx, nss, participants, executor, osi); + opCtx, nss, participants, executor, osi, true /* fromMigrate */); } } // namespace @@ -1208,6 +1209,12 @@ void CreateCollectionCoordinator::_commit(OperationContext* opCtx, const std::shared_ptr<executor::TaskExecutor>& executor) { LOGV2_DEBUG(5277906, 2, "Create collection _commit", "namespace"_attr = nss()); + if (MONGO_unlikely(failAtCommitCreateCollectionCoordinator.shouldFail())) { + LOGV2_DEBUG(6960301, 2, "About to hit failAtCommitCreateCollectionCoordinator fail point"); + uasserted(ErrorCodes::InterruptedAtShutdown, + "failAtCommitCreateCollectionCoordinator fail point"); + } + // Upsert Chunks. _updateSession(opCtx); insertChunks(opCtx, _initialChunks->chunks, getCurrentSession()); |