diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2021-06-09 10:59:12 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-14 15:02:20 +0000 |
commit | 8dc84fb6e8f0773eb11b6c34d06ebda07d1eaedb (patch) | |
tree | c3247cb26fe69d33bff0a22829b3013bbd05ca15 | |
parent | fd808e64b2a34bedfeeef012c2ef9314bec08e8f (diff) | |
download | mongo-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.cpp | 10 |
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()); |