diff options
-rw-r--r-- | src/mongo/db/s/operation_sharding_state.h | 10 | ||||
-rw-r--r-- | src/mongo/db/s/shard_server_op_observer.cpp | 7 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/mongo/db/s/operation_sharding_state.h b/src/mongo/db/s/operation_sharding_state.h index a8b31541cab..4bc818fecaf 100644 --- a/src/mongo/db/s/operation_sharding_state.h +++ b/src/mongo/db/s/operation_sharding_state.h @@ -69,12 +69,12 @@ public: static bool isOperationVersioned(OperationContext* opCtx); /** - * Instantiating this object on the stack indicates to the storage execution subsystem that it - * is allowed to create a collection in this context and that the caller is responsible for - * notifying the shard Sharding sybsystem of the collection creation. + * NOTE: DO NOT ADD any new usages of this class without including someone from the Sharding + * Team on the code review. * - * DO NOT add any new usages of this class without including someone from the Sharding Team on - * the code review. + * Instantiating this object on the stack indicates to the storage execution subsystem that it + * is allowed to create any collection in this context and that the caller will be responsible + * for notifying the shard Sharding sybsystem of the collection creation. */ class ScopedAllowImplicitCollectionCreate_UNSAFE { public: diff --git a/src/mongo/db/s/shard_server_op_observer.cpp b/src/mongo/db/s/shard_server_op_observer.cpp index 2fe0145fd53..f78889954f3 100644 --- a/src/mongo/db/s/shard_server_op_observer.cpp +++ b/src/mongo/db/s/shard_server_op_observer.cpp @@ -575,11 +575,8 @@ void ShardServerOpObserver::onCreateCollection(OperationContext* opCtx, "CreateCollectionCoordinator", oss._allowCollectionCreation); - // If the check above passes, this means the caller is responsible to eventially set the shard - // version for the collection - // - // TODO (SERVER-55284): Delete the lines below once all usages of - // ScopedAllowImplicitCollectionCreate_UNSAFE have been removed + // If the check above passes, this means the collection doesn't exist and is being created and + // that the caller will be responsible to eventially set the proper shard version auto* const csr = CollectionShardingRuntime::get(opCtx, collectionName); if (!csr->getCurrentMetadataIfKnown()) { csr->setFilteringMetadata(opCtx, CollectionMetadata()); |