diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2022-03-10 09:14:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-10 10:00:45 +0000 |
commit | d03d37af8b5ef60d828579e537ae0aab1f290719 (patch) | |
tree | 7d1ca1cf2e4db324be8a5ee2655c12f76e253023 /src/mongo/db/s/flush_routing_table_cache_updates_command.cpp | |
parent | db137621456c0db1e8e2362c525e347433a0f43f (diff) | |
download | mongo-d03d37af8b5ef60d828579e537ae0aab1f290719.tar.gz |
SERVER-63327 Make the Stale* exception handling uniform in all code paths
Diffstat (limited to 'src/mongo/db/s/flush_routing_table_cache_updates_command.cpp')
-rw-r--r-- | src/mongo/db/s/flush_routing_table_cache_updates_command.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/db/s/flush_routing_table_cache_updates_command.cpp b/src/mongo/db/s/flush_routing_table_cache_updates_command.cpp index a387f7fae82..943b78ece6d 100644 --- a/src/mongo/db/s/flush_routing_table_cache_updates_command.cpp +++ b/src/mongo/db/s/flush_routing_table_cache_updates_command.cpp @@ -112,7 +112,7 @@ public: << " if in read-only mode", !storageGlobalParams.readOnly); - auto& oss = OperationShardingState::get(opCtx); + boost::optional<SharedSemiFuture<void>> criticalSectionSignal; { AutoGetCollection autoColl(opCtx, ns(), MODE_IS); @@ -123,14 +123,12 @@ public: // propagated back to this shard. This ensures the read your own writes causal // consistency guarantee. auto const csr = CollectionShardingRuntime::get(opCtx, ns()); - auto criticalSectionSignal = + criticalSectionSignal = csr->getCriticalSectionSignal(opCtx, ShardingMigrationCriticalSection::kWrite); - if (criticalSectionSignal) { - oss.setMigrationCriticalSectionSignal(criticalSectionSignal); - } } - oss.waitForMigrationCriticalSectionSignal(opCtx); + if (criticalSectionSignal) + criticalSectionSignal->get(opCtx); if (Base::request().getSyncFromConfig()) { LOGV2_DEBUG(21982, |