diff options
author | Cheahuychou Mao <cheahuychou.mao@mongodb.com> | 2019-12-06 16:30:41 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-12-06 16:30:41 +0000 |
commit | eba76c558b3e7d784c146b51ced16d48b1d0efe7 (patch) | |
tree | eb43d876af50dfd29a6596878f15ed9ab500a30b /src/mongo/db/service_entry_point_mongod.cpp | |
parent | 13944bb3fedc8d91c02c56bb66bb5c76a0a558d0 (diff) | |
download | mongo-eba76c558b3e7d784c146b51ced16d48b1d0efe7.tar.gz |
SERVER-44719 Make createIndexes, dropIndexes, and collMod check shard versions
Diffstat (limited to 'src/mongo/db/service_entry_point_mongod.cpp')
-rw-r--r-- | src/mongo/db/service_entry_point_mongod.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/service_entry_point_mongod.cpp b/src/mongo/db/service_entry_point_mongod.cpp index c01f3260dc6..178b912a9f0 100644 --- a/src/mongo/db/service_entry_point_mongod.cpp +++ b/src/mongo/db/service_entry_point_mongod.cpp @@ -40,6 +40,7 @@ #include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/repl/speculative_majority_read_info.h" #include "mongo/db/s/implicit_create_collection.h" +#include "mongo/db/s/operation_sharding_state.h" #include "mongo/db/s/scoped_operation_completion_sharding_actions.h" #include "mongo/db/s/shard_filtering_metadata_refresh.h" #include "mongo/db/s/sharding_config_optime_gossip.h" @@ -182,6 +183,13 @@ public: void handleException(const DBException& e, OperationContext* opCtx) const override { // If we got a stale config, wait in case the operation is stuck in a critical section if (auto sce = e.extraInfo<StaleConfigInfo>()) { + if (sce->getCriticalSectionSignal()) { + // Set migration critical section on operation sharding state: operation will wait + // for the migration to finish before returning. + auto& oss = OperationShardingState::get(opCtx); + oss.setMigrationCriticalSectionSignal(sce->getCriticalSectionSignal()); + } + if (!opCtx->getClient()->isInDirectClient()) { // We already have the StaleConfig exception, so just swallow any errors due to // refresh |