summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/flush_routing_table_cache_updates_command.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2022-03-10 09:14:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-10 10:00:45 +0000
commitd03d37af8b5ef60d828579e537ae0aab1f290719 (patch)
tree7d1ca1cf2e4db324be8a5ee2655c12f76e253023 /src/mongo/db/s/flush_routing_table_cache_updates_command.cpp
parentdb137621456c0db1e8e2362c525e347433a0f43f (diff)
downloadmongo-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.cpp10
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,