summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2021-06-09 10:59:12 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-14 15:02:20 +0000
commit8dc84fb6e8f0773eb11b6c34d06ebda07d1eaedb (patch)
treec3247cb26fe69d33bff0a22829b3013bbd05ca15
parentfd808e64b2a34bedfeeef012c2ef9314bec08e8f (diff)
downloadmongo-8dc84fb6e8f0773eb11b6c34d06ebda07d1eaedb.tar.gz
SERVER-52764 Invariant that 'getOwnershipFilter' is never called without a valid shardVersion
-rw-r--r--src/mongo/db/s/collection_sharding_runtime.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mongo/db/s/collection_sharding_runtime.cpp b/src/mongo/db/s/collection_sharding_runtime.cpp
index 15e73931ec1..4ffd8278106 100644
--- a/src/mongo/db/s/collection_sharding_runtime.cpp
+++ b/src/mongo/db/s/collection_sharding_runtime.cpp
@@ -104,13 +104,9 @@ CollectionShardingRuntime* CollectionShardingRuntime::get_UNSAFE(ServiceContext*
ScopedCollectionFilter CollectionShardingRuntime::getOwnershipFilter(
OperationContext* opCtx, OrphanCleanupPolicy orphanCleanupPolicy) {
const auto optReceivedShardVersion = getOperationReceivedVersion(opCtx, _nss);
- // TODO (SERVER-52764): No operations should be calling getOwnershipFilter without a shard
- // version
- //
- // invariant(optReceivedShardVersion,
- // "getOwnershipFilter called by operation that doesn't specify shard version");
- if (!optReceivedShardVersion)
- return {kUnshardedCollection};
+ // No operations should be calling getOwnershipFilter without a shard version
+ invariant(optReceivedShardVersion,
+ "getOwnershipFilter called by operation that doesn't specify shard version");
auto metadata = _getMetadataWithVersionCheckAt(
opCtx, repl::ReadConcernArgs::get(opCtx).getArgsAtClusterTime());