diff options
Diffstat (limited to 'storage')
7 files changed, 11 insertions, 81 deletions
diff --git a/storage/src/tests/distributor/distributor_stripe_test.cpp b/storage/src/tests/distributor/distributor_stripe_test.cpp index 92cd3898886..d2afa7f3f77 100644 --- a/storage/src/tests/distributor/distributor_stripe_test.cpp +++ b/storage/src/tests/distributor/distributor_stripe_test.cpp @@ -57,7 +57,7 @@ struct DistributorStripeTest : Test, DistributorStripeTestUtil { return _stripe->_bucketDBMetricUpdater.getMinimumReplicaCountingMode(); } - std::string testOp(std::shared_ptr<api::StorageMessage> msg) { + std::string testOp(const std::shared_ptr<api::StorageMessage> & msg) { _stripe->handleMessage(msg); std::string tmp = _sender.getCommands(); @@ -83,8 +83,8 @@ struct DistributorStripeTest : Test, DistributorStripeTestUtil { std::vector<BucketCopy> changedNodes; vespalib::StringTokenizer tokenizer(states[i], ","); - for (uint32_t j = 0; j < tokenizer.size(); ++j) { - vespalib::StringTokenizer tokenizer2(tokenizer[j], ":"); + for (auto token : tokenizer) { + vespalib::StringTokenizer tokenizer2(token, ":"); bool trusted = false; if (tokenizer2.size() > 2) { @@ -96,14 +96,7 @@ struct DistributorStripeTest : Test, DistributorStripeTestUtil { removedNodes.push_back(node); } else { uint32_t checksum = atoi(tokenizer2[1].data()); - changedNodes.push_back( - BucketCopy( - i + 1, - node, - api::BucketInfo( - checksum, - checksum / 2, - checksum / 4)).setTrusted(trusted)); + changedNodes.emplace_back(i + 1, node, api::BucketInfo(checksum, checksum / 2, checksum / 4)).setTrusted(trusted); } } @@ -112,9 +105,7 @@ struct DistributorStripeTest : Test, DistributorStripeTestUtil { uint32_t flags(DatabaseUpdate::CREATE_IF_NONEXISTING | (resetTrusted ? DatabaseUpdate::RESET_TRUSTED : 0)); - operation_context().update_bucket_database(makeDocumentBucket(document::BucketId(16, 1)), - changedNodes, - flags); + operation_context().update_bucket_database(makeDocumentBucket(document::BucketId(16, 1)), changedNodes, flags); } std::string retVal = dumpBucket(document::BucketId(16, 1)); @@ -122,8 +113,8 @@ struct DistributorStripeTest : Test, DistributorStripeTestUtil { return retVal; } - void assertBucketSpaceStats(size_t expBucketPending, size_t expBucketTotal, uint16_t node, const vespalib::string& bucketSpace, - const BucketSpacesStatsProvider::PerNodeBucketSpacesStats& stats); + static void assertBucketSpaceStats(size_t expBucketPending, size_t expBucketTotal, uint16_t node, const vespalib::string& bucketSpace, + const BucketSpacesStatsProvider::PerNodeBucketSpacesStats& stats); SimpleMaintenanceScanner::PendingMaintenanceStats stripe_maintenance_stats() { return _stripe->pending_maintenance_stats(); @@ -175,12 +166,6 @@ struct DistributorStripeTest : Test, DistributorStripeTestUtil { }); } - void configure_prioritize_global_bucket_merges(bool enabled) { - configure_stripe_with([&](auto& builder) { - builder.prioritizeGlobalBucketMerges = enabled; - }); - } - void configure_max_activation_inhibited_out_of_sync_groups(uint32_t n_groups) { configure_stripe_with([&](auto& builder) { builder.maxActivationInhibitedOutOfSyncGroups = n_groups; @@ -969,17 +954,6 @@ TEST_F(DistributorStripeTest, weak_internal_read_consistency_config_is_propagate EXPECT_FALSE(getExternalOperationHandler().use_weak_internal_read_consistency_for_gets()); } -TEST_F(DistributorStripeTest, prioritize_global_bucket_merges_config_is_propagated_to_internal_config) -{ - setup_stripe(Redundancy(1), NodeCount(1), "distributor:1 storage:1"); - - configure_prioritize_global_bucket_merges(true); - EXPECT_TRUE(getConfig().prioritize_global_bucket_merges()); - - configure_prioritize_global_bucket_merges(false); - EXPECT_FALSE(getConfig().prioritize_global_bucket_merges()); -} - TEST_F(DistributorStripeTest, max_activation_inhibited_out_of_sync_groups_config_is_propagated_to_internal_config) { setup_stripe(Redundancy(1), NodeCount(1), "distributor:1 storage:1"); diff --git a/storage/src/tests/distributor/statecheckerstest.cpp b/storage/src/tests/distributor/statecheckerstest.cpp index 0f48440b5a1..a0d45292c1d 100644 --- a/storage/src/tests/distributor/statecheckerstest.cpp +++ b/storage/src/tests/distributor/statecheckerstest.cpp @@ -16,7 +16,6 @@ #include <vespa/storageapi/message/stat.h> #include <vespa/vdslib/distribution/distribution.h> #include <vespa/vespalib/gtest/gtest.h> -#include <gmock/gmock.h> using document::test::makeBucketSpace; using document::test::makeDocumentBucket; @@ -175,7 +174,6 @@ struct StateCheckersTest : Test, DistributorStripeTestUtil { bool _includeMessagePriority {false}; bool _includeSchedulingPriority {false}; bool _merge_operations_disabled {false}; - bool _prioritize_global_bucket_merges {true}; bool _config_enable_default_space_merge_inhibition {false}; bool _merges_inhibited_in_bucket_space {false}; CheckerParams(); @@ -217,10 +215,6 @@ struct StateCheckersTest : Test, DistributorStripeTestUtil { _merge_operations_disabled = disabled; return *this; } - CheckerParams& prioritize_global_bucket_merges(bool enabled) noexcept { - _prioritize_global_bucket_merges = enabled; - return *this; - } CheckerParams& bucket_space(document::BucketSpace bucket_space) noexcept { _bucket_space = bucket_space; return *this; @@ -246,7 +240,6 @@ struct StateCheckersTest : Test, DistributorStripeTestUtil { enable_cluster_state(params._clusterState); vespa::config::content::core::StorDistributormanagerConfigBuilder config; config.mergeOperationsDisabled = params._merge_operations_disabled; - config.prioritizeGlobalBucketMerges = params._prioritize_global_bucket_merges; config.inhibitDefaultMergesWhenGlobalMergesPending = params._config_enable_default_space_merge_inhibition; configure_stripe(config); if (!params._pending_cluster_state.empty()) { @@ -734,7 +727,7 @@ TEST_F(StateCheckersTest, synchronize_and_move) { .clusterState("distributor:1 storage:4")); } -TEST_F(StateCheckersTest, global_bucket_merges_have_very_high_priority_if_prioritization_enabled) { +TEST_F(StateCheckersTest, global_bucket_merges_have_very_high_priority) { runAndVerify<SynchronizeAndMoveStateChecker>( CheckerParams().expect( "[Synchronizing buckets with different checksums " @@ -745,23 +738,7 @@ TEST_F(StateCheckersTest, global_bucket_merges_have_very_high_priority_if_priori .bucketInfo("0=1,1=2") .bucket_space(document::FixedBucketSpaces::global_space()) .includeSchedulingPriority(true) - .includeMessagePriority(true) - .prioritize_global_bucket_merges(true)); -} - -TEST_F(StateCheckersTest, global_bucket_merges_have_normal_priority_if_prioritization_disabled) { - runAndVerify<SynchronizeAndMoveStateChecker>( - CheckerParams().expect( - "[Synchronizing buckets with different checksums " - "node(idx=0,crc=0x1,docs=1/1,bytes=1/1,trusted=false,active=false,ready=false), " - "node(idx=1,crc=0x2,docs=2/2,bytes=2/2,trusted=false,active=false,ready=false)] " - "(pri 120) " - "(scheduling pri MEDIUM)") - .bucketInfo("0=1,1=2") - .bucket_space(document::FixedBucketSpaces::global_space()) - .includeSchedulingPriority(true) - .includeMessagePriority(true) - .prioritize_global_bucket_merges(false)); + .includeMessagePriority(true)); } // Upon entering a cluster state transition edge the distributor will diff --git a/storage/src/vespa/storage/bucketdb/bucketinfo.h b/storage/src/vespa/storage/bucketdb/bucketinfo.h index 8f9b3d3486a..8b37c50e00e 100644 --- a/storage/src/vespa/storage/bucketdb/bucketinfo.h +++ b/storage/src/vespa/storage/bucketdb/bucketinfo.h @@ -91,7 +91,7 @@ public: /** * Returns the number of nodes this entry has. */ - uint32_t getNodeCount() const noexcept { return static_cast<uint32_t>(_nodes.size()); } + uint16_t getNodeCount() const noexcept { return static_cast<uint16_t>(_nodes.size()); } /** * Returns a list of the nodes this entry has. diff --git a/storage/src/vespa/storage/config/distributorconfiguration.cpp b/storage/src/vespa/storage/config/distributorconfiguration.cpp index 83be5d71b23..350116ca2a5 100644 --- a/storage/src/vespa/storage/config/distributorconfiguration.cpp +++ b/storage/src/vespa/storage/config/distributorconfiguration.cpp @@ -47,7 +47,6 @@ DistributorConfiguration::DistributorConfiguration(StorageComponent& component) _merge_operations_disabled(false), _use_weak_internal_read_consistency_for_client_gets(false), _enable_metadata_only_fetch_phase_for_inconsistent_updates(false), - _prioritize_global_bucket_merges(true), _implicitly_clear_priority_on_schedule(false), _use_unordered_merge_chaining(false), _inhibit_default_merges_when_global_merges_pending(false), @@ -171,7 +170,6 @@ DistributorConfiguration::configure(const vespa::config::content::core::StorDist _merge_operations_disabled = config.mergeOperationsDisabled; _use_weak_internal_read_consistency_for_client_gets = config.useWeakInternalReadConsistencyForClientGets; _enable_metadata_only_fetch_phase_for_inconsistent_updates = config.enableMetadataOnlyFetchPhaseForInconsistentUpdates; - _prioritize_global_bucket_merges = config.prioritizeGlobalBucketMerges; _max_activation_inhibited_out_of_sync_groups = config.maxActivationInhibitedOutOfSyncGroups; _implicitly_clear_priority_on_schedule = config.implicitlyClearBucketPriorityOnSchedule; _use_unordered_merge_chaining = config.useUnorderedMergeChaining; diff --git a/storage/src/vespa/storage/config/distributorconfiguration.h b/storage/src/vespa/storage/config/distributorconfiguration.h index 9d879fa62d5..7bb035345cb 100644 --- a/storage/src/vespa/storage/config/distributorconfiguration.h +++ b/storage/src/vespa/storage/config/distributorconfiguration.h @@ -249,13 +249,6 @@ public: return _max_consecutively_inhibited_maintenance_ticks; } - void set_prioritize_global_bucket_merges(bool prioritize) noexcept { - _prioritize_global_bucket_merges = prioritize; - } - bool prioritize_global_bucket_merges() const noexcept { - return _prioritize_global_bucket_merges; - } - void set_max_activation_inhibited_out_of_sync_groups(uint32_t max_groups) noexcept { _max_activation_inhibited_out_of_sync_groups = max_groups; } @@ -350,7 +343,6 @@ private: bool _merge_operations_disabled; bool _use_weak_internal_read_consistency_for_client_gets; bool _enable_metadata_only_fetch_phase_for_inconsistent_updates; - bool _prioritize_global_bucket_merges; bool _implicitly_clear_priority_on_schedule; bool _use_unordered_merge_chaining; bool _inhibit_default_merges_when_global_merges_pending; diff --git a/storage/src/vespa/storage/config/stor-distributormanager.def b/storage/src/vespa/storage/config/stor-distributormanager.def index 8c4f1d5bb17..117c76d132c 100644 --- a/storage/src/vespa/storage/config/stor-distributormanager.def +++ b/storage/src/vespa/storage/config/stor-distributormanager.def @@ -237,15 +237,6 @@ enable_metadata_only_fetch_phase_for_inconsistent_updates bool default=true ## accesses when the distributor is heavily loaded with feed operations. max_consecutively_inhibited_maintenance_ticks int default=20 -## If set, pending merges to buckets in the global bucket space will be prioritized -## higher than merges to buckets in the default bucket space. This ensures that global -## documents will be kept in sync without being starved by non-global documents. -## Note that enabling this feature risks starving default bucket space merges if a -## resource exhaustion case prevents global merges from completing. -## This is a live config for that reason, i.e. it can be disabled in an emergency -## situation if needed. -prioritize_global_bucket_merges bool default=true - ## If set, activation of bucket replicas is limited to only those replicas that have ## bucket info consistent with a majority of the other replicas for that bucket. ## Multiple active replicas is only a feature that is enabled for grouped clusters, diff --git a/storage/src/vespa/storage/distributor/statecheckers.cpp b/storage/src/vespa/storage/distributor/statecheckers.cpp index 97641ae86a6..1f45d79cd06 100644 --- a/storage/src/vespa/storage/distributor/statecheckers.cpp +++ b/storage/src/vespa/storage/distributor/statecheckers.cpp @@ -807,9 +807,7 @@ SynchronizeAndMoveStateChecker::check(const Context &c) const c.distributorConfig.getMaxNodesPerMerge()); op->setDetailedReason(result.reason()); MaintenancePriority::Priority schedPri; - if ((c.getBucketSpace() == document::FixedBucketSpaces::default_space()) - || !c.distributorConfig.prioritize_global_bucket_merges()) - { + if (c.getBucketSpace() == document::FixedBucketSpaces::default_space()) { schedPri = (result.needsMoveOnly() ? MaintenancePriority::LOW : MaintenancePriority::MEDIUM); op->setPriority(result.priority()); } else { |