summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/s/force_routing_table_refresh_command.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/db/s/force_routing_table_refresh_command.cpp b/src/mongo/db/s/force_routing_table_refresh_command.cpp
index 16db83b4d49..0ca0c80bb8b 100644
--- a/src/mongo/db/s/force_routing_table_refresh_command.cpp
+++ b/src/mongo/db/s/force_routing_table_refresh_command.cpp
@@ -106,6 +106,8 @@ public:
"Can't issue forceRoutingTableRefresh from 'eval'",
!opCtx->getClient()->isInDirectClient());
+ auto& oss = OperationShardingState::get(opCtx);
+
const NamespaceString nss(parseNs(dbname, cmdObj));
{
@@ -116,17 +118,17 @@ public:
// of the commit (and new writes to the committed chunk) that hasn't yet propagated back
// to this shard. This ensures the read your own writes causal consistency guarantee.
auto css = CollectionShardingState::get(opCtx, nss);
- if (css && css->getMigrationSourceManager()) {
+ if (css->getMigrationSourceManager()) {
auto criticalSectionSignal =
css->getMigrationSourceManager()->getMigrationCriticalSectionSignal(true);
if (criticalSectionSignal) {
- auto& oss = OperationShardingState::get(opCtx);
oss.setMigrationCriticalSectionSignal(criticalSectionSignal);
- oss.waitForMigrationCriticalSectionSignal(opCtx);
}
}
}
+ oss.waitForMigrationCriticalSectionSignal(opCtx);
+
LOG(1) << "Forcing routing table refresh for " << nss;
ChunkVersion unusedShardVersion;