From 947b8c17af4ed513ce22615ddd595527985df46a Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Wed, 14 Sep 2022 14:17:46 +0000 Subject: Add internal content node feature for not implicitly indexing active buckets --- storage/src/tests/distributor/top_level_bucket_db_updater_test.cpp | 7 +++++++ storage/src/tests/storageapi/mbusprot/storageprotocoltest.cpp | 1 + storage/src/vespa/storage/distributor/node_supported_features.h | 1 + storage/src/vespa/storage/distributor/pendingclusterstate.cpp | 5 +++-- storage/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto | 5 +++-- storage/src/vespa/storageapi/mbusprot/protocolserialization7.cpp | 6 ++++-- storage/src/vespa/storageapi/message/bucket.h | 5 +++-- 7 files changed, 22 insertions(+), 8 deletions(-) diff --git a/storage/src/tests/distributor/top_level_bucket_db_updater_test.cpp b/storage/src/tests/distributor/top_level_bucket_db_updater_test.cpp index 19ec51f4ed4..7b4f688b253 100644 --- a/storage/src/tests/distributor/top_level_bucket_db_updater_test.cpp +++ b/storage/src/tests/distributor/top_level_bucket_db_updater_test.cpp @@ -2512,6 +2512,7 @@ TEST_F(TopLevelBucketDBUpdaterTest, node_feature_sets_are_aggregated_from_nodes_ for (uint16_t i : {0, 1, 2}) { EXPECT_FALSE(s->node_supported_features_repo().node_supported_features(i).unordered_merge_chaining); EXPECT_FALSE(s->node_supported_features_repo().node_supported_features(i).two_phase_remove_location); + EXPECT_FALSE(s->node_supported_features_repo().node_supported_features(i).no_implicit_indexing_of_active_buckets); } } @@ -2524,6 +2525,7 @@ TEST_F(TopLevelBucketDBUpdaterTest, node_feature_sets_are_aggregated_from_nodes_ if (i > 0) { reply.supported_node_features().unordered_merge_chaining = true; reply.supported_node_features().two_phase_remove_location = true; + reply.supported_node_features().no_implicit_indexing_of_active_buckets = true; } })); } @@ -2532,10 +2534,15 @@ TEST_F(TopLevelBucketDBUpdaterTest, node_feature_sets_are_aggregated_from_nodes_ for (auto* s : stripes) { EXPECT_FALSE(s->node_supported_features_repo().node_supported_features(0).unordered_merge_chaining); EXPECT_FALSE(s->node_supported_features_repo().node_supported_features(0).two_phase_remove_location); + EXPECT_FALSE(s->node_supported_features_repo().node_supported_features(0).no_implicit_indexing_of_active_buckets); + EXPECT_TRUE(s->node_supported_features_repo().node_supported_features(1).unordered_merge_chaining); EXPECT_TRUE(s->node_supported_features_repo().node_supported_features(1).two_phase_remove_location); + EXPECT_TRUE(s->node_supported_features_repo().node_supported_features(1).no_implicit_indexing_of_active_buckets); + EXPECT_TRUE(s->node_supported_features_repo().node_supported_features(2).unordered_merge_chaining); EXPECT_TRUE(s->node_supported_features_repo().node_supported_features(2).two_phase_remove_location); + EXPECT_TRUE(s->node_supported_features_repo().node_supported_features(2).no_implicit_indexing_of_active_buckets); } } diff --git a/storage/src/tests/storageapi/mbusprot/storageprotocoltest.cpp b/storage/src/tests/storageapi/mbusprot/storageprotocoltest.cpp index 5ed2e0d96b4..344c909c13e 100644 --- a/storage/src/tests/storageapi/mbusprot/storageprotocoltest.cpp +++ b/storage/src/tests/storageapi/mbusprot/storageprotocoltest.cpp @@ -389,6 +389,7 @@ TEST_P(StorageProtocolTest, request_bucket_info) { EXPECT_TRUE(reply2->supported_node_features().unordered_merge_chaining); EXPECT_TRUE(reply2->supported_node_features().two_phase_remove_location); + EXPECT_TRUE(reply2->supported_node_features().no_implicit_indexing_of_active_buckets); } } diff --git a/storage/src/vespa/storage/distributor/node_supported_features.h b/storage/src/vespa/storage/distributor/node_supported_features.h index 87b2a9aef8e..bbd17403a6d 100644 --- a/storage/src/vespa/storage/distributor/node_supported_features.h +++ b/storage/src/vespa/storage/distributor/node_supported_features.h @@ -13,6 +13,7 @@ namespace storage::distributor { struct NodeSupportedFeatures { bool unordered_merge_chaining = false; bool two_phase_remove_location = false; + bool no_implicit_indexing_of_active_buckets = false; bool operator==(const NodeSupportedFeatures& rhs) const noexcept = default; }; diff --git a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp index dadbda60021..cf32d21eb82 100644 --- a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp +++ b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp @@ -340,8 +340,9 @@ PendingClusterState::update_node_supported_features_from_reply(uint16_t node, co { const auto& src_feat = reply.supported_node_features(); NodeSupportedFeatures dest_feat; - dest_feat.unordered_merge_chaining = src_feat.unordered_merge_chaining; - dest_feat.two_phase_remove_location = src_feat.two_phase_remove_location; + dest_feat.unordered_merge_chaining = src_feat.unordered_merge_chaining; + dest_feat.two_phase_remove_location = src_feat.two_phase_remove_location; + dest_feat.no_implicit_indexing_of_active_buckets = src_feat.no_implicit_indexing_of_active_buckets; // This will overwrite per bucket-space reply, but does not matter since it's independent of bucket space. _node_features.insert(std::make_pair(node, dest_feat)); } diff --git a/storage/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto b/storage/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto index a79ac9fd99a..0c1df005a5a 100644 --- a/storage/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto +++ b/storage/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto @@ -110,8 +110,9 @@ message BucketAndBucketInfo { } message SupportedNodeFeatures { - bool unordered_merge_chaining = 1; - bool two_phase_remove_location = 2; + bool unordered_merge_chaining = 1; + bool two_phase_remove_location = 2; + bool no_implicit_indexing_of_active_buckets = 3; } message RequestBucketInfoResponse { diff --git a/storage/src/vespa/storageapi/mbusprot/protocolserialization7.cpp b/storage/src/vespa/storageapi/mbusprot/protocolserialization7.cpp index 662408c4e95..151facf36e6 100644 --- a/storage/src/vespa/storageapi/mbusprot/protocolserialization7.cpp +++ b/storage/src/vespa/storageapi/mbusprot/protocolserialization7.cpp @@ -1058,6 +1058,7 @@ void ProtocolSerialization7::onEncode(GBBuf& buf, const api::RequestBucketInfoRe if (msg.full_bucket_fetch()) { res.mutable_supported_node_features()->set_unordered_merge_chaining(true); res.mutable_supported_node_features()->set_two_phase_remove_location(true); + res.mutable_supported_node_features()->set_no_implicit_indexing_of_active_buckets(true); } }); } @@ -1098,8 +1099,9 @@ api::StorageReply::UP ProtocolSerialization7::onDecodeRequestBucketInfoReply(con if (res.has_supported_node_features()) { const auto& src_features = res.supported_node_features(); auto& dest_features = reply->supported_node_features(); - dest_features.unordered_merge_chaining = src_features.unordered_merge_chaining(); - dest_features.two_phase_remove_location = src_features.two_phase_remove_location(); + dest_features.unordered_merge_chaining = src_features.unordered_merge_chaining(); + dest_features.two_phase_remove_location = src_features.two_phase_remove_location(); + dest_features.no_implicit_indexing_of_active_buckets = src_features.no_implicit_indexing_of_active_buckets(); } return reply; }); diff --git a/storage/src/vespa/storageapi/message/bucket.h b/storage/src/vespa/storageapi/message/bucket.h index d9843236d2e..ab61a9202c8 100644 --- a/storage/src/vespa/storageapi/message/bucket.h +++ b/storage/src/vespa/storageapi/message/bucket.h @@ -393,8 +393,9 @@ public: friend std::ostream& operator<<(std::ostream& os, const Entry&); }; struct SupportedNodeFeatures { - bool unordered_merge_chaining = false; - bool two_phase_remove_location = false; + bool unordered_merge_chaining = false; + bool two_phase_remove_location = false; + bool no_implicit_indexing_of_active_buckets = false; }; using EntryVector = vespalib::Array; private: -- cgit v1.2.3