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/s/scoped_operation_completion_sharding_actions.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/s/scoped_operation_completion_sharding_actions.cpp')
-rw-r--r-- | src/mongo/db/s/scoped_operation_completion_sharding_actions.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/s/scoped_operation_completion_sharding_actions.cpp b/src/mongo/db/s/scoped_operation_completion_sharding_actions.cpp index 625f62a51f3..4d544948696 100644 --- a/src/mongo/db/s/scoped_operation_completion_sharding_actions.cpp +++ b/src/mongo/db/s/scoped_operation_completion_sharding_actions.cpp @@ -73,6 +73,13 @@ ScopedOperationCompletionShardingActions::~ScopedOperationCompletionShardingActi } if (auto staleInfo = status->extraInfo<StaleConfigInfo>()) { + if (staleInfo->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(staleInfo->getCriticalSectionSignal()); + } + auto handleMismatchStatus = onShardVersionMismatchNoExcept( _opCtx, staleInfo->getNss(), staleInfo->getVersionReceived()); if (!handleMismatchStatus.isOK()) |