summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/shard_server_op_observer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/shard_server_op_observer.cpp')
-rw-r--r--src/mongo/db/s/shard_server_op_observer.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/db/s/shard_server_op_observer.cpp b/src/mongo/db/s/shard_server_op_observer.cpp
index 4d0f59a36df..622225a9977 100644
--- a/src/mongo/db/s/shard_server_op_observer.cpp
+++ b/src/mongo/db/s/shard_server_op_observer.cpp
@@ -76,10 +76,9 @@ public:
CatalogCacheLoader::get(_opCtx).notifyOfCollectionVersionUpdate(_nss);
- // This is a hack to get around CollectionShardingState::refreshMetadata() requiring the X
- // lock: markNotShardedAtStepdown() doesn't have a lock check. Temporary measure until
- // SERVER-31595 removes the X lock requirement.
- CollectionShardingRuntime::get(_opCtx, _nss)->markNotShardedAtStepdown();
+ // Force subsequent uses of the namespace to refresh the filtering metadata so they can
+ // synchronize with any work happening on the primary (e.g., migration critical section).
+ CollectionShardingRuntime::get(_opCtx, _nss)->clearFilteringMetadata();
}
void rollback() override {}
@@ -281,10 +280,10 @@ void ShardServerOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateE
}
if (setField.hasField(ShardCollectionType::enterCriticalSectionCounter.name())) {
- // This is a hack to get around CollectionShardingState::refreshMetadata() requiring
- // the X lock: markNotShardedAtStepdown() doesn't have a lock check. Temporary
- // measure until SERVER-31595 removes the X lock requirement.
- CollectionShardingRuntime::get(opCtx, updatedNss)->markNotShardedAtStepdown();
+ // Force subsequent uses of the namespace to refresh the filtering metadata so they
+ // can synchronize with any work happening on the primary (e.g., migration critical
+ // section).
+ CollectionShardingRuntime::get(opCtx, updatedNss)->clearFilteringMetadata();
}
}
}