summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2021-09-29 14:27:11 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-29 15:06:24 +0000
commitd930e6bcc7c8535c930bcc3d1d719a7551b3a325 (patch)
treeb38f298f32ad1378541411a8f7cc44bcee54cf34
parenta433f99db68b62e216005d606281fa52356ed8b7 (diff)
downloadmongo-d930e6bcc7c8535c930bcc3d1d719a7551b3a325.tar.gz
SERVER-60092 Remove TODO referencing ScopedAllowImplicitCollectionCreate_UNSAFE
-rw-r--r--src/mongo/db/s/operation_sharding_state.h10
-rw-r--r--src/mongo/db/s/shard_server_op_observer.cpp7
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());