diff options
Diffstat (limited to 'src/mongo')
37 files changed, 69 insertions, 172 deletions
diff --git a/src/mongo/db/s/analyze_shard_key_read_write_distribution_test.cpp b/src/mongo/db/s/analyze_shard_key_read_write_distribution_test.cpp index 276b5991868..9dbd8f7ed66 100644 --- a/src/mongo/db/s/analyze_shard_key_read_write_distribution_test.cpp +++ b/src/mongo/db/s/analyze_shard_key_read_write_distribution_test.cpp @@ -119,7 +119,6 @@ protected: timestamp, boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* maxChunkSizeBytes */, true /* allowMigrations */, chunks); diff --git a/src/mongo/db/s/balancer/balance_stats_test.cpp b/src/mongo/db/s/balancer/balance_stats_test.cpp index 911188c8363..c8b6addb870 100644 --- a/src/mongo/db/s/balancer/balance_stats_test.cpp +++ b/src/mongo/db/s/balancer/balance_stats_test.cpp @@ -59,7 +59,6 @@ public: _timestamp, // timestamp boost::none, // time series fields boost::none, // resharding fields - boost::none, // chunk size bytes true, // allowMigration chunks); diff --git a/src/mongo/db/s/chunk_manager_refresh_bm.cpp b/src/mongo/db/s/chunk_manager_refresh_bm.cpp index 8e18a5e3e51..fad17e0b701 100644 --- a/src/mongo/db/s/chunk_manager_refresh_bm.cpp +++ b/src/mongo/db/s/chunk_manager_refresh_bm.cpp @@ -87,8 +87,7 @@ CollectionMetadata makeChunkManagerWithShardSelector(int nShards, collEpoch, Timestamp(1, 0), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, chunks); return CollectionMetadata(ChunkManager(ShardId("Shard0"), @@ -121,7 +120,7 @@ MONGO_COMPILER_NOINLINE auto makeChunkManagerWithOptimalBalancedDistribution(int MONGO_COMPILER_NOINLINE auto runIncrementalUpdate(const CollectionMetadata& cm, const std::vector<ChunkType>& newChunks) { auto rt = cm.getChunkManager()->getRoutingTableHistory_ForTest().makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, newChunks); + boost::none /* timeseriesFields */, boost::none /* reshardingFields */, true, newChunks); return CollectionMetadata(ChunkManager(ShardId("shard0"), DatabaseVersion(UUID::gen(), Timestamp(1, 0)), makeStandaloneRoutingTableHistory(std::move(rt)), @@ -180,8 +179,7 @@ auto BM_FullBuildOfChunkManager(benchmark::State& state, ShardSelectorFn selectS collEpoch, Timestamp(1, 0), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, chunks); benchmark::DoNotOptimize( diff --git a/src/mongo/db/s/collection_metadata_filtering_test.cpp b/src/mongo/db/s/collection_metadata_filtering_test.cpp index 771904eb229..aae08d987eb 100644 --- a/src/mongo/db/s/collection_metadata_filtering_test.cpp +++ b/src/mongo/db/s/collection_metadata_filtering_test.cpp @@ -74,8 +74,7 @@ protected: epoch, Timestamp(1, 1), timeseriesFields, - boost::none, - boost::none, + boost::none /* reshardingFields */, true, [&] { ChunkVersion version({epoch, Timestamp(1, 1)}, {1, 0}); diff --git a/src/mongo/db/s/collection_metadata_test.cpp b/src/mongo/db/s/collection_metadata_test.cpp index 18114ec79a4..a7ecaa36577 100644 --- a/src/mongo/db/s/collection_metadata_test.cpp +++ b/src/mongo/db/s/collection_metadata_test.cpp @@ -101,7 +101,6 @@ CollectionMetadata makeCollectionMetadataImpl( timestamp, boost::none /* timeseriesFields */, std::move(reshardingFields), - boost::none /* chunkSizeBytes */, true, allChunks)), kChunkManager), diff --git a/src/mongo/db/s/collection_sharding_runtime_test.cpp b/src/mongo/db/s/collection_sharding_runtime_test.cpp index 8b0a06703a3..ea934294256 100644 --- a/src/mongo/db/s/collection_sharding_runtime_test.cpp +++ b/src/mongo/db/s/collection_sharding_runtime_test.cpp @@ -84,8 +84,8 @@ protected: epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + true, {std::move(chunk)})), boost::none); diff --git a/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp b/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp index 9db453a3942..ca90eef2efc 100644 --- a/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp +++ b/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp @@ -173,7 +173,6 @@ CollectionRoutingInfoTargeter makeCollectionRoutingInfoTargeter( validAfter, boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* maxChunkSizeBytes */, true /* allowMigrations */, chunks); diff --git a/src/mongo/db/s/global_index/global_index_cloner_fetcher_test.cpp b/src/mongo/db/s/global_index/global_index_cloner_fetcher_test.cpp index 2f759496bd8..9d32f2f2934 100644 --- a/src/mongo/db/s/global_index/global_index_cloner_fetcher_test.cpp +++ b/src/mongo/db/s/global_index/global_index_cloner_fetcher_test.cpp @@ -76,7 +76,6 @@ public: Timestamp(1, 1), boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* chunkSizeBytes */, false, chunks); diff --git a/src/mongo/db/s/global_index/global_index_cloning_service_test.cpp b/src/mongo/db/s/global_index/global_index_cloning_service_test.cpp index aedd0a6b5be..96b8e60993a 100644 --- a/src/mongo/db/s/global_index/global_index_cloning_service_test.cpp +++ b/src/mongo/db/s/global_index/global_index_cloning_service_test.cpp @@ -92,7 +92,6 @@ public: Timestamp(1, 1), boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* chunkSizeBytes */, true /* allowMigrations */, chunks); diff --git a/src/mongo/db/s/metadata_manager_test.cpp b/src/mongo/db/s/metadata_manager_test.cpp index 0f1c9ab2de9..e8c2d3154ac 100644 --- a/src/mongo/db/s/metadata_manager_test.cpp +++ b/src/mongo/db/s/metadata_manager_test.cpp @@ -95,8 +95,8 @@ protected: epoch, Timestamp(1, 1), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + true, {ChunkType{uuid, range, ChunkVersion({epoch, Timestamp(1, 1)}, {1, 0}), kOtherShard}}); @@ -149,8 +149,11 @@ protected: chunkVersion, kOtherShard); - auto rt = cm->getRoutingTableHistory_ForTest().makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, splitChunks); + auto rt = + cm->getRoutingTableHistory_ForTest().makeUpdated(boost::none /* timeseriesFields */, + boost::none /* reshardingFields */, + true, + splitChunks); return CollectionMetadata(ChunkManager(cm->dbPrimary(), cm->dbVersion(), @@ -176,8 +179,7 @@ protected: auto rt = cm->getRoutingTableHistory_ForTest().makeUpdated( boost::none /* timeseriesFields */, - boost::none, - boost::none, + boost::none /* reshardingFields */, true, {ChunkType(metadata.getUUID(), ChunkRange(minKey, maxKey), chunkVersion, kOtherShard)}); diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp index 2e079a09de7..bceac76154c 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp @@ -617,7 +617,6 @@ protected: timestamp, boost::none /* timeseriesFields */, boost::none /* resharding Fields */, - boost::none /* chunkSizeBytes */, true, {ChunkType{uuid, ChunkRange{BSON(kShardKey << MINKEY), BSON(kShardKey << MAXKEY)}, diff --git a/src/mongo/db/s/op_observer_sharding_test.cpp b/src/mongo/db/s/op_observer_sharding_test.cpp index 455a715715b..65754edcd71 100644 --- a/src/mongo/db/s/op_observer_sharding_test.cpp +++ b/src/mongo/db/s/op_observer_sharding_test.cpp @@ -102,8 +102,8 @@ protected: epoch, Timestamp(1, 1), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + true, {std::move(chunk)}); diff --git a/src/mongo/db/s/range_deleter_service_test.cpp b/src/mongo/db/s/range_deleter_service_test.cpp index 65ce779c7c4..ab5513ecebb 100644 --- a/src/mongo/db/s/range_deleter_service_test.cpp +++ b/src/mongo/db/s/range_deleter_service_test.cpp @@ -107,8 +107,8 @@ void RangeDeleterServiceTest::_setFilteringMetadataByUUID(OperationContext* opCt epoch, Timestamp(1, 1), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + true, {std::move(chunk)})), boost::none); diff --git a/src/mongo/db/s/range_deletion_util_test.cpp b/src/mongo/db/s/range_deletion_util_test.cpp index d8ea266e1f7..c04869cb31e 100644 --- a/src/mongo/db/s/range_deletion_util_test.cpp +++ b/src/mongo/db/s/range_deletion_util_test.cpp @@ -107,8 +107,8 @@ public: epoch, Timestamp(1, 1), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + true, {ChunkType{uuid, ChunkRange{BSON(kShardKey << MINKEY), BSON(kShardKey << MAXKEY)}, diff --git a/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp b/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp index 60afefd3c16..28d61bc48d3 100644 --- a/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp +++ b/src/mongo/db/s/resharding/resharding_collection_cloner_test.cpp @@ -162,8 +162,7 @@ protected: epoch, Timestamp(1, 1), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, false, chunks); diff --git a/src/mongo/db/s/resharding/resharding_data_replication_test.cpp b/src/mongo/db/s/resharding/resharding_data_replication_test.cpp index fd6ed5a9188..5eabc1a3787 100644 --- a/src/mongo/db/s/resharding/resharding_data_replication_test.cpp +++ b/src/mongo/db/s/resharding/resharding_data_replication_test.cpp @@ -84,7 +84,6 @@ public: Timestamp(1, 1), boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* chunkSizeBytes */, true /* allowMigrations */, chunks); diff --git a/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.cpp b/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.cpp index 95abf9d2e86..eea75c8761a 100644 --- a/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.cpp +++ b/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.cpp @@ -128,8 +128,8 @@ protected: epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + true, {std::move(chunk)})), boost::none); diff --git a/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp index 3edd51bdec9..1fc013463e1 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp @@ -249,8 +249,8 @@ public: epoch, Timestamp(1, 1), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + false, chunks); diff --git a/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp index 1bac61a4258..487e8717038 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp @@ -331,7 +331,6 @@ private: Timestamp(1, 1), boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* chunkSizeBytes */, true /* allowMigrations */, chunks); diff --git a/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp index 0f5aa1674df..c4ddf755489 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp @@ -275,7 +275,6 @@ private: Timestamp(1, 1), boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* chunkSizeBytes */, true /* allowMigrations */, chunks); return ChunkManager(shardId, diff --git a/src/mongo/db/s/resharding/resharding_recipient_service_test.cpp b/src/mongo/db/s/resharding/resharding_recipient_service_test.cpp index a19679edc6d..2ee479d5b9b 100644 --- a/src/mongo/db/s/resharding/resharding_recipient_service_test.cpp +++ b/src/mongo/db/s/resharding/resharding_recipient_service_test.cpp @@ -95,7 +95,6 @@ public: Timestamp(1, 1), boost::none /* timeseriesFields */, boost::none /* reshardingFields */, - boost::none /* chunkSizeBytes */, true /* allowMigrations */, chunks); IndexCatalogTypeMap shardingIndexesCatalogMap; diff --git a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp index 6cb080c4350..36e32873952 100644 --- a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp +++ b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp @@ -105,8 +105,6 @@ Status persistCollectionAndChangedChunks(OperationContext* opCtx, update.setDefaultCollation(collAndChunks.defaultCollation); update.setTimeseriesFields(collAndChunks.timeseriesFields); update.setReshardingFields(collAndChunks.reshardingFields); - update.setMaxChunkSizeBytes(collAndChunks.maxChunkSizeBytes); - update.setAllowAutoSplit(collAndChunks.allowAutoSplit); update.setAllowMigrations(collAndChunks.allowMigrations); update.setRefreshing(true); // Mark as refreshing so secondaries are aware of it. @@ -255,8 +253,6 @@ CollectionAndChangedChunks getPersistedMetadataSinceVersion(OperationContext* op shardCollectionEntry.getUnique(), shardCollectionEntry.getTimeseriesFields(), shardCollectionEntry.getReshardingFields(), - shardCollectionEntry.getMaxChunkSizeBytes(), - shardCollectionEntry.getAllowAutoSplit(), shardCollectionEntry.getAllowMigrations(), std::move(changedChunks)}; } @@ -963,8 +959,6 @@ StatusWith<CollectionAndChangedChunks> ShardServerCatalogCacheLoader::_getLoader persisted.timestamp = enqueued.timestamp; persisted.timeseriesFields = std::move(enqueued.timeseriesFields); persisted.reshardingFields = std::move(enqueued.reshardingFields); - persisted.maxChunkSizeBytes = enqueued.maxChunkSizeBytes; - persisted.allowAutoSplit = enqueued.allowAutoSplit; persisted.allowMigrations = enqueued.allowMigrations; return persisted; @@ -1527,8 +1521,6 @@ ShardServerCatalogCacheLoader::CollAndChunkTaskList::getEnqueuedMetadataForTerm( // Keep the most recent version of these fields collAndChunks.allowMigrations = task.collectionAndChangedChunks->allowMigrations; - collAndChunks.maxChunkSizeBytes = task.collectionAndChangedChunks->maxChunkSizeBytes; - collAndChunks.allowAutoSplit = task.collectionAndChangedChunks->allowAutoSplit; collAndChunks.reshardingFields = task.collectionAndChangedChunks->reshardingFields; collAndChunks.timeseriesFields = task.collectionAndChangedChunks->timeseriesFields; } diff --git a/src/mongo/db/s/sharding_write_router_bm.cpp b/src/mongo/db/s/sharding_write_router_bm.cpp index ddaaf5ce43c..527cc992b0c 100644 --- a/src/mongo/db/s/sharding_write_router_bm.cpp +++ b/src/mongo/db/s/sharding_write_router_bm.cpp @@ -126,7 +126,6 @@ std::pair<std::vector<mongo::ChunkType>, mongo::ChunkManager> createChunks( collTimestamp, boost::none /* timeseriesFields */, reshardingFields, /* reshardingFields */ - boost::none /* chunkSizeBytes */, true, chunks)), boost::none); diff --git a/src/mongo/db/s/type_shard_collection.h b/src/mongo/db/s/type_shard_collection.h index a9b3e1fe801..7a923b08c97 100644 --- a/src/mongo/db/s/type_shard_collection.h +++ b/src/mongo/db/s/type_shard_collection.h @@ -52,12 +52,10 @@ public: using ShardCollectionTypeBase::kUuidFieldName; // Make getters and setters accessible. - using ShardCollectionTypeBase::getAllowAutoSplit; using ShardCollectionTypeBase::getDefaultCollation; using ShardCollectionTypeBase::getEnterCriticalSectionCounter; using ShardCollectionTypeBase::getEpoch; using ShardCollectionTypeBase::getKeyPattern; - using ShardCollectionTypeBase::getMaxChunkSizeBytes; using ShardCollectionTypeBase::getNss; using ShardCollectionTypeBase::getRefreshing; using ShardCollectionTypeBase::getReshardingFields; @@ -65,11 +63,9 @@ public: using ShardCollectionTypeBase::getTimestamp; using ShardCollectionTypeBase::getUnique; using ShardCollectionTypeBase::getUuid; - using ShardCollectionTypeBase::setAllowAutoSplit; using ShardCollectionTypeBase::setDefaultCollation; using ShardCollectionTypeBase::setEnterCriticalSectionCounter; using ShardCollectionTypeBase::setKeyPattern; - using ShardCollectionTypeBase::setMaxChunkSizeBytes; using ShardCollectionTypeBase::setRefreshing; using ShardCollectionTypeBase::setReshardingFields; using ShardCollectionTypeBase::setTimeseriesFields; diff --git a/src/mongo/db/s/type_shard_collection.idl b/src/mongo/db/s/type_shard_collection.idl index 1b55e8ac911..064761d5ba8 100644 --- a/src/mongo/db/s/type_shard_collection.idl +++ b/src/mongo/db/s/type_shard_collection.idl @@ -116,15 +116,6 @@ structs: collection is the temporary resharding collection." type: TypeCollectionReshardingFields optional: true - maxChunkSizeBytes: - type: safeInt64 - description: "Max chunk size in bytes." - optional: true - allowAutoSplit: - type: bool - description: "Specifies whether the auto-splitter should be running or not for this - collection." - default: true allowMigrations: cpp_name: pre50CompatibleAllowMigrations type: bool diff --git a/src/mongo/db/shard_role_test.cpp b/src/mongo/db/shard_role_test.cpp index 456a5b539c0..2dc888976f3 100644 --- a/src/mongo/db/shard_role_test.cpp +++ b/src/mongo/db/shard_role_test.cpp @@ -100,7 +100,6 @@ void installShardedCollectionMetadata(OperationContext* opCtx, timestamp, boost::none /* timeseriesFields */, boost::none /* resharding Fields */, - boost::none /* chunkSizeBytes */, true /* allowMigrations */, chunks); diff --git a/src/mongo/s/catalog/type_collection.h b/src/mongo/s/catalog/type_collection.h index 0f5644316d6..26d093d3896 100644 --- a/src/mongo/s/catalog/type_collection.h +++ b/src/mongo/s/catalog/type_collection.h @@ -147,18 +147,15 @@ public: BSONObj getDefaultCollation() const { return CollectionTypeBase::getDefaultCollation().get_value_or(BSONObj()); } - void setDefaultCollation(const BSONObj& defaultCollation); void setMaxChunkSizeBytes(int64_t value); + void setDefaultCollation(const BSONObj& defaultCollation); + bool getDefragmentCollection() const { return CollectionTypeBase::getDefragmentCollection().get_value_or(false); } - bool getAllowAutoSplit() const { - return !getNoAutoSplit().get_value_or(false); - } - bool getAllowBalance() const { return !getNoBalance() && !getDefragmentCollection(); } diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp index 997f5164311..a8778d9e6d9 100644 --- a/src/mongo/s/catalog_cache.cpp +++ b/src/mongo/s/catalog_cache.cpp @@ -110,23 +110,6 @@ std::shared_ptr<RoutingTableHistory> createUpdatedRoutingTableHistory( return existingHistory->optRt; } - const auto maxChunkSize = [&]() -> boost::optional<uint64_t> { - if (!collectionAndChunks.allowAutoSplit) { - // maxChunkSize = 0 is an invalid chunkSize so we use it to detect noAutoSplit - // on the steady-state path in incrementChunkOnInsertOrUpdate(...) - return 0; - } - if (collectionAndChunks.maxChunkSizeBytes) { - tassert(7032312, - fmt::format("Invalid maxChunkSizeBytes value {} for collection '{}'", - nss.toString(), - collectionAndChunks.maxChunkSizeBytes.value()), - collectionAndChunks.maxChunkSizeBytes.value() > 0); - return uint64_t(*collectionAndChunks.maxChunkSizeBytes); - } - return boost::none; - }(); - auto newRoutingHistory = [&] { // If we have routing info already and it's for the same collection, we're updating. // Otherwise, we are making a whole new routing table. @@ -135,7 +118,6 @@ std::shared_ptr<RoutingTableHistory> createUpdatedRoutingTableHistory( {collectionAndChunks.epoch, collectionAndChunks.timestamp})) { return existingHistory->optRt->makeUpdated(collectionAndChunks.timeseriesFields, collectionAndChunks.reshardingFields, - maxChunkSize, collectionAndChunks.allowMigrations, collectionAndChunks.changedChunks); } @@ -158,7 +140,6 @@ std::shared_ptr<RoutingTableHistory> createUpdatedRoutingTableHistory( collectionAndChunks.timestamp, collectionAndChunks.timeseriesFields, std::move(collectionAndChunks.reshardingFields), - maxChunkSize, collectionAndChunks.allowMigrations, collectionAndChunks.changedChunks); }(); diff --git a/src/mongo/s/catalog_cache_loader.cpp b/src/mongo/s/catalog_cache_loader.cpp index fde061a7a3b..876845b8743 100644 --- a/src/mongo/s/catalog_cache_loader.cpp +++ b/src/mongo/s/catalog_cache_loader.cpp @@ -50,8 +50,6 @@ CatalogCacheLoader::CollectionAndChangedChunks::CollectionAndChangedChunks( bool collShardKeyIsUnique, boost::optional<TypeCollectionTimeseriesFields> collTimeseriesFields, boost::optional<TypeCollectionReshardingFields> collReshardingFields, - boost::optional<int64_t> maxChunkSizeBytes, - bool allowAutoSplit, bool allowMigrations, std::vector<ChunkType> chunks) : epoch(std::move(epoch)), @@ -62,8 +60,6 @@ CatalogCacheLoader::CollectionAndChangedChunks::CollectionAndChangedChunks( shardKeyIsUnique(collShardKeyIsUnique), timeseriesFields(std::move(collTimeseriesFields)), reshardingFields(std::move(collReshardingFields)), - maxChunkSizeBytes(std::move(maxChunkSizeBytes)), - allowAutoSplit(allowAutoSplit), allowMigrations(allowMigrations), changedChunks(std::move(chunks)) {} diff --git a/src/mongo/s/catalog_cache_loader.h b/src/mongo/s/catalog_cache_loader.h index d71c658eca0..053e72b4175 100644 --- a/src/mongo/s/catalog_cache_loader.h +++ b/src/mongo/s/catalog_cache_loader.h @@ -75,8 +75,6 @@ public: bool collShardKeyIsUnique, boost::optional<TypeCollectionTimeseriesFields> collTimeseriesFields, boost::optional<TypeCollectionReshardingFields> collReshardingFields, - boost::optional<int64_t> maxChunkSizeBytes, - bool allowAutoSplit, bool allowMigrations, std::vector<ChunkType> chunks); @@ -96,10 +94,6 @@ public: // populated. boost::optional<TypeCollectionReshardingFields> reshardingFields; - boost::optional<int64_t> maxChunkSizeBytes; - - bool allowAutoSplit; - bool allowMigrations; // The chunks which have changed sorted by their chunkVersion. This list might potentially diff --git a/src/mongo/s/catalog_cache_loader_mock.cpp b/src/mongo/s/catalog_cache_loader_mock.cpp index f4c88b509b5..2c190ce6530 100644 --- a/src/mongo/s/catalog_cache_loader_mock.cpp +++ b/src/mongo/s/catalog_cache_loader_mock.cpp @@ -97,8 +97,6 @@ CollectionAndChangedChunks getCollectionRefresh( swCollectionReturnValue.getValue().getUnique(), swCollectionReturnValue.getValue().getTimeseriesFields(), reshardingFields, - swCollectionReturnValue.getValue().getMaxChunkSizeBytes(), - swCollectionReturnValue.getValue().getAllowAutoSplit(), swCollectionReturnValue.getValue().getAllowMigrations(), std::move(chunks)}; } diff --git a/src/mongo/s/chunk_manager.cpp b/src/mongo/s/chunk_manager.cpp index be53098d78b..181fdd63b89 100644 --- a/src/mongo/s/chunk_manager.cpp +++ b/src/mongo/s/chunk_manager.cpp @@ -317,7 +317,6 @@ RoutingTableHistory::RoutingTableHistory( bool unique, boost::optional<TypeCollectionTimeseriesFields> timeseriesFields, boost::optional<TypeCollectionReshardingFields> reshardingFields, - boost::optional<uint64_t> maxChunkSizeBytes, bool allowMigrations, ChunkMap chunkMap) : _nss(std::move(nss)), @@ -327,7 +326,6 @@ RoutingTableHistory::RoutingTableHistory( _unique(unique), _timeseriesFields(std::move(timeseriesFields)), _reshardingFields(std::move(reshardingFields)), - _maxChunkSizeBytes(maxChunkSizeBytes), _allowMigrations(allowMigrations), _chunkMap(std::move(chunkMap)), _placementVersions(_chunkMap.constructShardPlacementVersionMap()) {} @@ -497,20 +495,6 @@ bool ChunkManager::allowMigrations() const { return _rt->optRt->allowMigrations(); } -bool ChunkManager::allowAutoSplit() const { - const auto maxChunkSize = maxChunkSizeBytes(); - if (!maxChunkSize) - return true; - - return *maxChunkSize != 0; -} - -boost::optional<uint64_t> ChunkManager::maxChunkSizeBytes() const { - if (!_rt->optRt) - return boost::none; - return _rt->optRt->maxChunkSizeBytes(); -} - std::string ChunkManager::toString() const { return _rt->optRt ? _rt->optRt->toString() : "UNSHARDED"; } @@ -578,7 +562,6 @@ RoutingTableHistory RoutingTableHistory::makeNew( const Timestamp& timestamp, boost::optional<TypeCollectionTimeseriesFields> timeseriesFields, boost::optional<TypeCollectionReshardingFields> reshardingFields, - boost::optional<uint64_t> maxChunkSizeBytes, bool allowMigrations, const std::vector<ChunkType>& chunks) { @@ -590,7 +573,6 @@ RoutingTableHistory RoutingTableHistory::makeNew( std::move(unique), std::move(timeseriesFields), std::move(reshardingFields), - maxChunkSizeBytes, allowMigrations, ChunkMap{epoch, timestamp}.createMerged(changedChunkInfos)); } @@ -601,7 +583,6 @@ RoutingTableHistory RoutingTableHistory::makeNew( RoutingTableHistory RoutingTableHistory::makeUpdated( boost::optional<TypeCollectionTimeseriesFields> timeseriesFields, boost::optional<TypeCollectionReshardingFields> reshardingFields, - boost::optional<uint64_t> maxChunkSizeBytes, bool allowMigrations, const std::vector<ChunkType>& changedChunks) const { @@ -618,7 +599,6 @@ RoutingTableHistory RoutingTableHistory::makeUpdated( isUnique(), std::move(timeseriesFields), std::move(reshardingFields), - maxChunkSizeBytes, allowMigrations, std::move(chunkMap)); } diff --git a/src/mongo/s/chunk_manager.h b/src/mongo/s/chunk_manager.h index 42c14ff4d2a..2f5ca4c4aed 100644 --- a/src/mongo/s/chunk_manager.h +++ b/src/mongo/s/chunk_manager.h @@ -165,7 +165,6 @@ public: const Timestamp& timestamp, boost::optional<TypeCollectionTimeseriesFields> timeseriesFields, boost::optional<TypeCollectionReshardingFields> reshardingFields, - boost::optional<uint64_t> maxChunkSizeBytes, bool allowMigrations, const std::vector<ChunkType>& chunks); @@ -185,7 +184,6 @@ public: RoutingTableHistory makeUpdated( boost::optional<TypeCollectionTimeseriesFields> timeseriesFields, boost::optional<TypeCollectionReshardingFields> reshardingFields, - boost::optional<uint64_t> maxChunkSizeBytes, bool allowMigrations, const std::vector<ChunkType>& changedChunks) const; @@ -300,11 +298,6 @@ public: return _allowMigrations; } - // collection default chunk size or +inf, iff no splits should happen - boost::optional<uint64_t> maxChunkSizeBytes() const { - return _maxChunkSizeBytes; - } - private: friend class ChunkManager; @@ -315,7 +308,6 @@ private: bool unique, boost::optional<TypeCollectionTimeseriesFields> timeseriesFields, boost::optional<TypeCollectionReshardingFields> reshardingFields, - boost::optional<uint64_t> maxChunkSizeBytes, bool allowMigrations, ChunkMap chunkMap); @@ -345,8 +337,6 @@ private: // for this collection. boost::optional<TypeCollectionReshardingFields> _reshardingFields; - boost::optional<uint64_t> _maxChunkSizeBytes; - bool _allowMigrations; // Map from the max for each chunk to an entry describing the chunk. The union of all chunks' @@ -523,10 +513,6 @@ public: */ bool allowMigrations() const; - bool allowAutoSplit() const; - - boost::optional<uint64_t> maxChunkSizeBytes() const; - const ShardId& dbPrimary() const { return _dbPrimary; } diff --git a/src/mongo/s/chunk_manager_query_test.cpp b/src/mongo/s/chunk_manager_query_test.cpp index 9b47635c0b6..76e9e8b5a69 100644 --- a/src/mongo/s/chunk_manager_query_test.cpp +++ b/src/mongo/s/chunk_manager_query_test.cpp @@ -560,8 +560,8 @@ TEST_F(ChunkManagerQueryTest, SnapshotQueryWithMoreShardsThanLatestMetadata) { epoch, Timestamp(1, 1), boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, + true, {chunk0, chunk1}); @@ -573,12 +573,14 @@ TEST_F(ChunkManagerQueryTest, SnapshotQueryWithMoreShardsThanLatestMetadata) { chunk1.setHistory({ChunkHistory(*chunk1.getOnCurrentShardSince(), ShardId("0")), ChunkHistory(Timestamp(1, 0), ShardId("1"))}); - ChunkManager chunkManager( - ShardId("0"), - DatabaseVersion(UUID::gen(), Timestamp(1, 1)), - makeStandaloneRoutingTableHistory(oldRoutingTable.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, {chunk1})), - Timestamp(5, 0)); + ChunkManager chunkManager(ShardId("0"), + DatabaseVersion(UUID::gen(), Timestamp(1, 1)), + makeStandaloneRoutingTableHistory( + oldRoutingTable.makeUpdated(boost::none /* timeseriesFields */, + boost::none /* reshardingFields */, + true, + {chunk1})), + Timestamp(5, 0)); std::set<ShardId> shardIds; chunkManager.getShardIdsForRange(BSON("x" << MINKEY), BSON("x" << MAXKEY), &shardIds); diff --git a/src/mongo/s/collection_routing_info_targeter_test.cpp b/src/mongo/s/collection_routing_info_targeter_test.cpp index 4e394920de4..1404a5a795d 100644 --- a/src/mongo/s/collection_routing_info_targeter_test.cpp +++ b/src/mongo/s/collection_routing_info_targeter_test.cpp @@ -261,7 +261,6 @@ ChunkManager makeCustomChunkManager(const ShardKeyPattern& shardKeyPattern, timestamp, boost::none, // time series fields boost::none, // resharding fields - boost::none, // chunk size bytes true, // allowMigration chunks); diff --git a/src/mongo/s/config_server_catalog_cache_loader.cpp b/src/mongo/s/config_server_catalog_cache_loader.cpp index 2ab15aa35d6..2c11b6b2c95 100644 --- a/src/mongo/s/config_server_catalog_cache_loader.cpp +++ b/src/mongo/s/config_server_catalog_cache_loader.cpp @@ -74,8 +74,6 @@ CollectionAndChangedChunks getChangedChunks(OperationContext* opCtx, coll.getUnique(), coll.getTimeseriesFields(), coll.getReshardingFields(), - coll.getMaxChunkSizeBytes(), - coll.getAllowAutoSplit(), coll.getAllowMigrations(), std::move(collAndChunks.second)}; } diff --git a/src/mongo/s/routing_table_history_test.cpp b/src/mongo/s/routing_table_history_test.cpp index ee51cfc8a63..a067f030c82 100644 --- a/src/mongo/s/routing_table_history_test.cpp +++ b/src/mongo/s/routing_table_history_test.cpp @@ -71,7 +71,7 @@ RoutingTableHistory splitChunk(const RoutingTableHistory& rt, } return rt.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, newChunks); + boost::none /* timeseriesFields */, boost::none /* reshardingFields */, true, newChunks); } /** @@ -132,8 +132,7 @@ public: epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, {initChunk})); ASSERT_EQ(_rt->numChunks(), 1ull); @@ -204,8 +203,7 @@ TEST_F(RoutingTableHistoryTest, TestSplits) { epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, {chunkAll}); @@ -219,8 +217,8 @@ TEST_F(RoutingTableHistoryTest, TestSplits) { ChunkVersion({epoch, timestamp}, {2, 2}), kThisShard}}; - auto rt1 = - rt.makeUpdated(boost::none /* timeseriesFields */, boost::none, boost::none, true, chunks1); + auto rt1 = rt.makeUpdated( + boost::none /* timeseriesFields */, boost::none /* reshardingFields */, true, chunks1); auto v1 = ChunkVersion({epoch, timestamp}, {2, 2}); ASSERT_EQ(v1, rt1.getVersion(kThisShard)); @@ -239,7 +237,7 @@ TEST_F(RoutingTableHistoryTest, TestSplits) { kThisShard}}; auto rt2 = rt1.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, chunks2); + boost::none /* timeseriesFields */, boost::none /* reshardingFields */, true, chunks2); auto v2 = ChunkVersion({epoch, timestamp}, {3, 2}); ASSERT_EQ(v2, rt2.getVersion(kThisShard)); } @@ -263,8 +261,7 @@ TEST_F(RoutingTableHistoryTest, TestReplaceEmptyChunk) { epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, initialChunks); ASSERT_EQ(rt.numChunks(), 1); @@ -279,8 +276,10 @@ TEST_F(RoutingTableHistoryTest, TestReplaceEmptyChunk) { ChunkVersion({epoch, timestamp}, {2, 2}), kThisShard}}; - auto rt1 = rt.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, changedChunks); + auto rt1 = rt.makeUpdated(boost::none /* timeseriesFields */, + boost::none /* reshardingFields */, + true, + changedChunks); auto v1 = ChunkVersion({epoch, timestamp}, {2, 2}); ASSERT_EQ(v1, rt1.getVersion(kThisShard)); ASSERT_EQ(rt1.numChunks(), 2); @@ -318,8 +317,7 @@ TEST_F(RoutingTableHistoryTest, TestUseLatestVersions) { epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, initialChunks); ASSERT_EQ(rt.numChunks(), 1); @@ -338,8 +336,10 @@ TEST_F(RoutingTableHistoryTest, TestUseLatestVersions) { ChunkVersion({epoch, timestamp}, {2, 2}), kThisShard}}; - auto rt1 = rt.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, changedChunks); + auto rt1 = rt.makeUpdated(boost::none /* timeseriesFields */, + boost::none /* reshardingFields */, + true, + changedChunks); auto v1 = ChunkVersion({epoch, timestamp}, {2, 2}); ASSERT_EQ(v1, rt1.getVersion(kThisShard)); ASSERT_EQ(rt1.numChunks(), 2); @@ -368,8 +368,7 @@ TEST_F(RoutingTableHistoryTest, TestOutOfOrderVersion) { epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, initialChunks); ASSERT_EQ(rt.numChunks(), 2); @@ -384,8 +383,10 @@ TEST_F(RoutingTableHistoryTest, TestOutOfOrderVersion) { ChunkVersion({epoch, timestamp}, {3, 1}), kThisShard}}; - auto rt1 = rt.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, changedChunks); + auto rt1 = rt.makeUpdated(boost::none /* timeseriesFields */, + boost::none /* reshardingFields */, + true, + changedChunks); auto v1 = ChunkVersion({epoch, timestamp}, {3, 1}); ASSERT_EQ(v1, rt1.getVersion(kThisShard)); ASSERT_EQ(rt1.numChunks(), 2); @@ -422,9 +423,8 @@ TEST_F(RoutingTableHistoryTest, TestMergeChunks) { false, epoch, timestamp, - boost::none, boost::none /* timeseriesFields */, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, initialChunks); ASSERT_EQ(rt.numChunks(), 3); @@ -440,8 +440,10 @@ TEST_F(RoutingTableHistoryTest, TestMergeChunks) { ChunkVersion({epoch, timestamp}, {3, 1}), kThisShard}}; - auto rt1 = rt.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, changedChunks); + auto rt1 = rt.makeUpdated(boost::none /* timeseriesFields */, + boost::none /* reshardingFields */, + true, + changedChunks); auto v1 = ChunkVersion({epoch, timestamp}, {3, 1}); ASSERT_EQ(v1, rt1.getVersion(kThisShard)); ASSERT_EQ(rt1.numChunks(), 2); @@ -474,8 +476,7 @@ TEST_F(RoutingTableHistoryTest, TestMergeChunksOrdering) { epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, initialChunks); ASSERT_EQ(rt.numChunks(), 3); @@ -491,8 +492,10 @@ TEST_F(RoutingTableHistoryTest, TestMergeChunksOrdering) { ChunkVersion({epoch, timestamp}, {3, 1}), kThisShard}}; - auto rt1 = rt.makeUpdated( - boost::none /* timeseriesFields */, boost::none, boost::none, true, changedChunks); + auto rt1 = rt.makeUpdated(boost::none /* timeseriesFields */, + boost::none /* reshardingFields */, + true, + changedChunks); auto v1 = ChunkVersion({epoch, timestamp}, {3, 1}); ASSERT_EQ(v1, rt1.getVersion(kThisShard)); ASSERT_EQ(rt1.numChunks(), 2); @@ -543,8 +546,7 @@ TEST_F(RoutingTableHistoryTest, TestFlatten) { epoch, timestamp, boost::none /* timeseriesFields */, - boost::none, - boost::none /* chunkSizeBytes */, + boost::none /* reshardingFields */, true, initialChunks); ASSERT_EQ(rt.numChunks(), 2); |