summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2021-03-23 10:50:36 +0100
committerGitHub <noreply@github.com>2021-03-23 10:50:36 +0100
commit50bec9bb93ec7502313decc1c82fd41efdfac06b (patch)
treecd60ce1542d054428fb13842aee8d6bb6d2ad530 /storage
parent89a4e253e43c8a4ef01f34a2773edaf054655e73 (diff)
parentb9a45b895428016f7b310dc11c1daf2d623ee445 (diff)
Merge pull request #17113 from vespa-engine/geirst/distributor-stripe-refactor-2
Distributor stripe refactor 2
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/distributor/distributortest.cpp2
-rw-r--r--storage/src/tests/distributor/idealstatemanagertest.cpp16
-rw-r--r--storage/src/tests/distributor/operationtargetresolvertest.cpp4
-rw-r--r--storage/src/tests/distributor/statecheckerstest.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/distributor_operation_context.h4
-rw-r--r--storage/src/vespa/storage/distributor/distributor_stripe_component.cpp136
-rw-r--r--storage/src/vespa/storage/distributor/distributor_stripe_component.h65
-rw-r--r--storage/src/vespa/storage/distributor/idealstatemanager.h3
-rw-r--r--storage/src/vespa/storage/distributor/operations/idealstate/garbagecollectionoperation.cpp6
-rw-r--r--storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp6
-rw-r--r--storage/src/vespa/storage/distributor/operations/idealstate/removebucketoperation.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/statechecker.cpp2
15 files changed, 111 insertions, 151 deletions
diff --git a/storage/src/tests/distributor/distributortest.cpp b/storage/src/tests/distributor/distributortest.cpp
index 6abe594388f..4c574609df5 100644
--- a/storage/src/tests/distributor/distributortest.cpp
+++ b/storage/src/tests/distributor/distributortest.cpp
@@ -122,7 +122,7 @@ struct DistributorTest : Test, DistributorTestUtil {
}
}
- distributor_component().removeNodesFromDB(makeDocumentBucket(document::BucketId(16, 1)), removedNodes);
+ operation_context().remove_nodes_from_bucket_database(makeDocumentBucket(document::BucketId(16, 1)), removedNodes);
uint32_t flags(DatabaseUpdate::CREATE_IF_NONEXISTING
| (resetTrusted ? DatabaseUpdate::RESET_TRUSTED : 0));
diff --git a/storage/src/tests/distributor/idealstatemanagertest.cpp b/storage/src/tests/distributor/idealstatemanagertest.cpp
index fd23dd5d656..ce9aa0a6800 100644
--- a/storage/src/tests/distributor/idealstatemanagertest.cpp
+++ b/storage/src/tests/distributor/idealstatemanagertest.cpp
@@ -64,17 +64,17 @@ struct IdealStateManagerTest : Test, DistributorTestUtil {
TEST_F(IdealStateManagerTest, sibling) {
EXPECT_EQ(document::BucketId(1,1),
- getIdealStateManager().getDistributorComponent()
- .getSibling(document::BucketId(1, 0)));
+ getIdealStateManager().operation_context()
+ .get_sibling(document::BucketId(1, 0)));
EXPECT_EQ(document::BucketId(1,0),
- getIdealStateManager().getDistributorComponent()
- .getSibling(document::BucketId(1, 1)));
+ getIdealStateManager().operation_context()
+ .get_sibling(document::BucketId(1, 1)));
EXPECT_EQ(document::BucketId(2,3),
- getIdealStateManager().getDistributorComponent()
- .getSibling(document::BucketId(2, 1)));
+ getIdealStateManager().operation_context()
+ .get_sibling(document::BucketId(2, 1)));
EXPECT_EQ(document::BucketId(2,1),
- getIdealStateManager().getDistributorComponent()
- .getSibling(document::BucketId(2, 3)));
+ getIdealStateManager().operation_context()
+ .get_sibling(document::BucketId(2, 3)));
}
TEST_F(IdealStateManagerTest, status_page) {
diff --git a/storage/src/tests/distributor/operationtargetresolvertest.cpp b/storage/src/tests/distributor/operationtargetresolvertest.cpp
index a19708d6a27..aea251e81de 100644
--- a/storage/src/tests/distributor/operationtargetresolvertest.cpp
+++ b/storage/src/tests/distributor/operationtargetresolvertest.cpp
@@ -116,7 +116,7 @@ OperationTargetResolverTest::getInstances(const BucketId& id,
bool stripToRedundancy)
{
lib::IdealNodeCalculatorImpl idealNodeCalc;
- auto &bucketSpaceRepo(distributor_component().getBucketSpaceRepo());
+ auto &bucketSpaceRepo(operation_context().bucket_space_repo());
auto &distributorBucketSpace(bucketSpaceRepo.get(makeBucketSpace()));
idealNodeCalc.setDistribution(distributorBucketSpace.getDistribution());
idealNodeCalc.setClusterState(distributorBucketSpace.getClusterState());
@@ -145,7 +145,7 @@ TEST_F(OperationTargetResolverTest, simple) {
TEST_F(OperationTargetResolverTest, multiple_nodes) {
setupDistributor(1, 2, "storage:2 distributor:1");
- auto &bucketSpaceRepo(distributor_component().getBucketSpaceRepo());
+ auto &bucketSpaceRepo(operation_context().bucket_space_repo());
auto &distributorBucketSpace(bucketSpaceRepo.get(makeBucketSpace()));
for (int i = 0; i < 100; ++i) {
addNodesToBucketDB(BucketId(16, i), "0=0,1=0");
diff --git a/storage/src/tests/distributor/statecheckerstest.cpp b/storage/src/tests/distributor/statecheckerstest.cpp
index 2f4c386e1ed..9b49f1347cc 100644
--- a/storage/src/tests/distributor/statecheckerstest.cpp
+++ b/storage/src/tests/distributor/statecheckerstest.cpp
@@ -78,8 +78,8 @@ struct StateCheckersTest : Test, DistributorTestUtil {
{
std::ostringstream ost;
- c.siblingBucket = getIdealStateManager().getDistributorComponent()
- .getSibling(c.getBucketId());
+ c.siblingBucket = getIdealStateManager().operation_context()
+ .get_sibling(c.getBucketId());
std::vector<BucketDatabase::Entry> entries;
getBucketDatabase(c.getBucketSpace()).getAll(c.getBucketId(), entries);
diff --git a/storage/src/vespa/storage/distributor/distributor_operation_context.h b/storage/src/vespa/storage/distributor/distributor_operation_context.h
index 0b47c71e2e1..d9277a33088 100644
--- a/storage/src/vespa/storage/distributor/distributor_operation_context.h
+++ b/storage/src/vespa/storage/distributor/distributor_operation_context.h
@@ -33,11 +33,15 @@ public:
const std::vector<BucketCopy>& changed_nodes,
uint32_t update_flags = 0) = 0;
virtual void remove_node_from_bucket_database(const document::Bucket& bucket, uint16_t node_index) = 0;
+ virtual void remove_nodes_from_bucket_database(const document::Bucket& bucket,
+ const std::vector<uint16_t>& nodes) = 0;
virtual const DistributorBucketSpaceRepo& bucket_space_repo() const noexcept= 0;
virtual DistributorBucketSpaceRepo& bucket_space_repo() noexcept = 0;
virtual const DistributorBucketSpaceRepo& read_only_bucket_space_repo() const noexcept = 0;
virtual DistributorBucketSpaceRepo& read_only_bucket_space_repo() noexcept = 0;
virtual document::BucketId make_split_bit_constrained_bucket_id(const document::DocumentId& docId) const = 0;
+ virtual void recheck_bucket_info(uint16_t node_index, const document::Bucket& bucket) = 0;
+ virtual document::BucketId get_sibling(const document::BucketId& bid) const = 0;
virtual const DistributorConfiguration& distributor_config() const noexcept = 0;
virtual void send_inline_split_if_bucket_too_large(document::BucketSpace bucket_space,
diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_component.cpp b/storage/src/vespa/storage/distributor/distributor_stripe_component.cpp
index 4aab82ee6f8..ee131adf8ff 100644
--- a/storage/src/vespa/storage/distributor/distributor_stripe_component.cpp
+++ b/storage/src/vespa/storage/distributor/distributor_stripe_component.cpp
@@ -1,4 +1,5 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
#include "distributor_stripe_component.h"
#include "distributor_bucket_space_repo.h"
#include "distributor_bucket_space.h"
@@ -41,56 +42,6 @@ DistributorStripeComponent::sendUp(const api::StorageMessage::SP& msg)
_distributor.getMessageSender().sendUp(msg);
}
-bool
-DistributorStripeComponent::checkDistribution(api::StorageCommand &cmd, const document::Bucket &bucket)
-{
- auto &bucket_space(_bucketSpaceRepo.get(bucket.getBucketSpace()));
- BucketOwnership bo(bucket_space.check_ownership_in_pending_and_current_state(bucket.getBucketId()));
- if (!bo.isOwned()) {
- std::string systemStateStr = bo.getNonOwnedState().toString();
- LOG(debug,
- "Got message with wrong distribution, bucket %s sending back state '%s'",
- bucket.toString().c_str(), systemStateStr.c_str());
-
- api::StorageReply::UP reply(cmd.makeReply());
- api::ReturnCode ret(api::ReturnCode::WRONG_DISTRIBUTION, systemStateStr);
- reply->setResult(ret);
- sendUp(std::shared_ptr<api::StorageMessage>(reply.release()));
- return false;
- }
- return true;
-}
-
-void
-DistributorStripeComponent::removeNodesFromDB(const document::Bucket &bucket, const std::vector<uint16_t>& nodes)
-{
- auto &bucketSpace(_bucketSpaceRepo.get(bucket.getBucketSpace()));
- BucketDatabase::Entry dbentry = bucketSpace.getBucketDatabase().get(bucket.getBucketId());
-
- if (dbentry.valid()) {
- for (uint32_t i = 0; i < nodes.size(); ++i) {
- if (dbentry->removeNode(nodes[i])) {
- LOG(debug,
- "Removed node %d from bucket %s. %u copies remaining",
- nodes[i],
- bucket.toString().c_str(),
- dbentry->getNodeCount());
- }
- }
-
- if (dbentry->getNodeCount() != 0) {
- bucketSpace.getBucketDatabase().update(dbentry);
- } else {
- LOG(debug,
- "After update, bucket %s now has no copies. "
- "Removing from database.",
- bucket.toString().c_str());
-
- bucketSpace.getBucketDatabase().remove(bucket.getBucketId());
- }
- }
-}
-
void
DistributorStripeComponent::enumerateUnavailableNodes(
std::vector<uint16_t>& unavailableNodes,
@@ -218,14 +169,64 @@ DistributorStripeComponent::update_bucket_database(
bucketSpace.getBucketDatabase().process_update(bucket.getBucketId(), processor, (update_flags & DatabaseUpdate::CREATE_IF_NONEXISTING) != 0);
}
+// Implements DistributorNodeContext
+api::StorageMessageAddress
+DistributorStripeComponent::node_address(uint16_t node_index) const noexcept
+{
+ return api::StorageMessageAddress::create(cluster_name_ptr(), lib::NodeType::STORAGE, node_index);
+}
+
+
+// Implements DistributorOperationContext
void
-DistributorStripeComponent::recheckBucketInfo(uint16_t nodeIdx, const document::Bucket &bucket)
+DistributorStripeComponent::remove_nodes_from_bucket_database(const document::Bucket& bucket,
+ const std::vector<uint16_t>& nodes)
{
- _distributor.recheckBucketInfo(nodeIdx, bucket);
+ auto &bucketSpace(_bucketSpaceRepo.get(bucket.getBucketSpace()));
+ BucketDatabase::Entry dbentry = bucketSpace.getBucketDatabase().get(bucket.getBucketId());
+
+ if (dbentry.valid()) {
+ for (uint32_t i = 0; i < nodes.size(); ++i) {
+ if (dbentry->removeNode(nodes[i])) {
+ LOG(debug,
+ "Removed node %d from bucket %s. %u copies remaining",
+ nodes[i],
+ bucket.toString().c_str(),
+ dbentry->getNodeCount());
+ }
+ }
+
+ if (dbentry->getNodeCount() != 0) {
+ bucketSpace.getBucketDatabase().update(dbentry);
+ } else {
+ LOG(debug,
+ "After update, bucket %s now has no copies. "
+ "Removing from database.",
+ bucket.toString().c_str());
+
+ bucketSpace.getBucketDatabase().remove(bucket.getBucketId());
+ }
+ }
+}
+
+document::BucketId
+DistributorStripeComponent::make_split_bit_constrained_bucket_id(const document::DocumentId& doc_id) const
+{
+ document::BucketId id(getBucketIdFactory().getBucketId(doc_id));
+
+ id.setUsedBits(_distributor.getConfig().getMinimalBucketSplit());
+ return id.stripUnused();
+}
+
+void
+DistributorStripeComponent::recheck_bucket_info(uint16_t node_index, const document::Bucket& bucket)
+{
+ _distributor.recheckBucketInfo(node_index, bucket);
}
document::BucketId
-DistributorStripeComponent::getSibling(const document::BucketId& bid) const {
+DistributorStripeComponent::get_sibling(const document::BucketId& bid) const
+{
document::BucketId zeroBucket;
document::BucketId oneBucket;
@@ -249,33 +250,6 @@ DistributorStripeComponent::getSibling(const document::BucketId& bid) const {
}
return (zeroBucket == bid) ? oneBucket : zeroBucket;
-};
-
-BucketDatabase::Entry
-DistributorStripeComponent::createAppropriateBucket(const document::Bucket &bucket)
-{
- auto &bucketSpace(_bucketSpaceRepo.get(bucket.getBucketSpace()));
- return bucketSpace.getBucketDatabase().createAppropriateBucket(
- _distributor.getConfig().getMinimalBucketSplit(),
- bucket.getBucketId());
-}
-
-// Implements DistributorNodeContext
-api::StorageMessageAddress
-DistributorStripeComponent::node_address(uint16_t node_index) const noexcept
-{
- return api::StorageMessageAddress::create(cluster_name_ptr(), lib::NodeType::STORAGE, node_index);
-}
-
-
-// Implements DistributorOperationContext
-document::BucketId
-DistributorStripeComponent::make_split_bit_constrained_bucket_id(const document::DocumentId& doc_id) const
-{
- document::BucketId id(getBucketIdFactory().getBucketId(doc_id));
-
- id.setUsedBits(_distributor.getConfig().getMinimalBucketSplit());
- return id.stripUnused();
}
bool
diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_component.h b/storage/src/vespa/storage/distributor/distributor_stripe_component.h
index ae54eacf9fd..cb69b963271 100644
--- a/storage/src/vespa/storage/distributor/distributor_stripe_component.h
+++ b/storage/src/vespa/storage/distributor/distributor_stripe_component.h
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "distributor_node_context.h"
@@ -42,26 +42,6 @@ public:
~DistributorStripeComponent() override;
- /**
- * Verifies that the given command has been received at the
- * correct distributor based on the current system state.
- */
- bool checkDistribution(api::StorageCommand& cmd, const document::Bucket &bucket);
-
- /**
- * Removes the given bucket copies from the bucket database.
- * If the resulting bucket is empty afterwards, removes the entire
- * bucket entry from the bucket database.
- */
- void removeNodesFromDB(const document::Bucket &bucket,
- const std::vector<uint16_t>& nodes);
-
- /**
- * Fetch bucket info about the given bucket from the given node.
- * Used when we get BUCKET_NOT_FOUND.
- */
- void recheckBucketInfo(uint16_t nodeIdx, const document::Bucket &bucket);
-
void sendDown(const api::StorageMessage::SP&);
void sendUp(const api::StorageMessage::SP&);
@@ -71,24 +51,6 @@ public:
return _distributor;
}
- DistributorBucketSpaceRepo &getBucketSpaceRepo() { return _bucketSpaceRepo; }
- const DistributorBucketSpaceRepo &getBucketSpaceRepo() const { return _bucketSpaceRepo; }
-
- DistributorBucketSpaceRepo& getReadOnlyBucketSpaceRepo() { return _readOnlyBucketSpaceRepo; }
- const DistributorBucketSpaceRepo& getReadOnlyBucketSpaceRepo() const { return _readOnlyBucketSpaceRepo; }
-
- /**
- * Finds a bucket that has the same direct parent as the given bucket
- * (i.e. split one bit less), but different bit in the most used bit.
- */
- document::BucketId getSibling(const document::BucketId& bid) const;
-
- /**
- * Create a bucket that is split correctly according to other buckets that
- * are in the bucket database.
- */
- BucketDatabase::Entry createAppropriateBucket(const document::Bucket &bucket);
-
// Implements DistributorNodeContext
const framework::Clock& clock() const noexcept override { return getClock(); }
const vespalib::string * cluster_name_ptr() const noexcept override { return cluster_context().cluster_name_ptr(); }
@@ -127,8 +89,17 @@ public:
* bucket entry from the bucket database.
*/
void remove_node_from_bucket_database(const document::Bucket& bucket, uint16_t node_index) override {
- removeNodesFromDB(bucket, toVector<uint16_t>(node_index));
+ remove_nodes_from_bucket_database(bucket, toVector<uint16_t>(node_index));
}
+
+ /**
+ * Removes the given bucket copies from the bucket database.
+ * If the resulting bucket is empty afterwards, removes the entire
+ * bucket entry from the bucket database.
+ */
+ void remove_nodes_from_bucket_database(const document::Bucket& bucket,
+ const std::vector<uint16_t>& nodes) override;
+
const DistributorBucketSpaceRepo& bucket_space_repo() const noexcept override {
return _bucketSpaceRepo;
}
@@ -142,6 +113,19 @@ public:
return _readOnlyBucketSpaceRepo;
}
document::BucketId make_split_bit_constrained_bucket_id(const document::DocumentId& doc_id) const override;
+
+ /**
+ * Fetch bucket info about the given bucket from the given node.
+ * Used when we get BUCKET_NOT_FOUND.
+ */
+ void recheck_bucket_info(uint16_t node_index, const document::Bucket& bucket) override;
+
+ /**
+ * Finds a bucket that has the same direct parent as the given bucket
+ * (i.e. split one bit less), but different bit in the most used bit.
+ */
+ document::BucketId get_sibling(const document::BucketId& bid) const override;
+
const DistributorConfiguration& distributor_config() const noexcept override {
return getDistributor().getConfig();
}
@@ -181,7 +165,6 @@ public:
// Implements DocumentSelectionParser
std::unique_ptr<document::select::Node> parse_selection(const vespalib::string& selection) const override;
-
private:
void enumerateUnavailableNodes(
std::vector<uint16_t>& unavailableNodes,
diff --git a/storage/src/vespa/storage/distributor/idealstatemanager.h b/storage/src/vespa/storage/distributor/idealstatemanager.h
index e5a38ab5161..363d66d8174 100644
--- a/storage/src/vespa/storage/distributor/idealstatemanager.h
+++ b/storage/src/vespa/storage/distributor/idealstatemanager.h
@@ -77,8 +77,7 @@ public:
getBucketStatus(out);
}
- // TODO STRIPE stop exposing this
- DistributorStripeComponent& getDistributorComponent() { return _distributorComponent; }
+ const DistributorNodeContext& node_context() const { return _distributorComponent; }
DistributorOperationContext& operation_context() { return _distributorComponent; }
const DistributorOperationContext& operation_context() const { return _distributorComponent; }
DistributorBucketSpaceRepo &getBucketSpaceRepo() { return _bucketSpaceRepo; }
diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/garbagecollectionoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/garbagecollectionoperation.cpp
index c2f48a9c3d9..c9e983d4284 100644
--- a/storage/src/vespa/storage/distributor/operations/idealstate/garbagecollectionoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/idealstate/garbagecollectionoperation.cpp
@@ -27,7 +27,7 @@ void GarbageCollectionOperation::onStart(DistributorMessageSender& sender) {
for (auto node : nodes) {
auto command = std::make_shared<api::RemoveLocationCommand>(
- _manager->getDistributorComponent().getDistributor().getConfig().getGarbageCollectionSelection(),
+ _manager->operation_context().distributor_config().getGarbageCollectionSelection(),
getBucket());
command->setPriority(_priority);
@@ -51,7 +51,7 @@ GarbageCollectionOperation::onReceive(DistributorMessageSender&,
uint16_t node = _tracker.handleReply(*rep);
if (!rep->getResult().failed()) {
- _replica_info.emplace_back(_manager->getDistributorComponent().getUniqueTimestamp(),
+ _replica_info.emplace_back(_manager->operation_context().generate_unique_timestamp(),
node, rep->getBucketInfo());
_max_documents_removed = std::max(_max_documents_removed, rep->documents_removed());
} else {
@@ -73,7 +73,7 @@ void GarbageCollectionOperation::merge_received_bucket_info_into_db() {
BucketDatabase::Entry dbentry = _bucketSpace->getBucketDatabase().get(getBucketId());
if (dbentry.valid()) {
dbentry->setLastGarbageCollectionTime(
- _manager->getDistributorComponent().getClock().getTimeInSeconds().getTime());
+ _manager->node_context().clock().getTimeInSeconds().getTime());
_bucketSpace->getBucketDatabase().update(dbentry);
}
}
diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp
index 4509e61746a..c2c43f86c42 100644
--- a/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp
@@ -120,7 +120,7 @@ JoinOperation::onReceive(DistributorMessageSender&, const api::StorageReply::SP&
} else {
_manager->operation_context().update_bucket_database(
getBucket(),
- BucketCopy(_manager->getDistributorComponent().getUniqueTimestamp(),
+ BucketCopy(_manager->operation_context().generate_unique_timestamp(),
node,
rep.getBucketInfo()),
DatabaseUpdate::CREATE_IF_NONEXISTING);
@@ -130,7 +130,7 @@ JoinOperation::onReceive(DistributorMessageSender&, const api::StorageReply::SP&
} else if (rep.getResult().getResult() == api::ReturnCode::BUCKET_NOT_FOUND
&& _bucketSpace->getBucketDatabase().get(getBucketId())->getNode(node) != 0)
{
- _manager->getDistributorComponent().recheckBucketInfo(node, getBucket());
+ _manager->operation_context().recheck_bucket_info(node, getBucket());
LOGBP(warning, "Join failed to find %s: %s",
getBucketId().toString().c_str(),
rep.getResult().toString().c_str());
diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp
index dfbff93757a..afb806e903a 100644
--- a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp
@@ -144,7 +144,7 @@ MergeOperation::onStart(DistributorMessageSender& sender)
auto msg = std::make_shared<api::MergeBucketCommand>(
getBucket(),
_mnodes,
- _manager->getDistributorComponent().getUniqueTimestamp(),
+ _manager->operation_context().generate_unique_timestamp(),
clusterState.getVersion());
// Due to merge forwarding/chaining semantics, we must always send
@@ -162,7 +162,7 @@ MergeOperation::onStart(DistributorMessageSender& sender)
sender.sendToNode(lib::NodeType::STORAGE, _mnodes[0].index, msg);
- _sentMessageTime = _manager->getDistributorComponent().getClock().getTimeInSeconds();
+ _sentMessageTime = _manager->node_context().clock().getTimeInSeconds();
} else {
LOGBP(debug,
"Unable to merge bucket %s, since only one copy is available. System state %s",
@@ -230,7 +230,7 @@ MergeOperation::deleteSourceOnlyNodes(
if (!sourceOnlyNodes.empty()) {
_removeOperation = std::make_unique<RemoveBucketOperation>(
- _manager->getDistributorComponent().cluster_context(),
+ _manager->node_context(),
BucketAndNodes(getBucket(), sourceOnlyNodes));
// Must not send removes to source only copies if something has caused
// pending load to the copy after the merge was sent!
diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/removebucketoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/removebucketoperation.cpp
index a8eee5caf49..6b06657d713 100644
--- a/storage/src/vespa/storage/distributor/operations/idealstate/removebucketoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/idealstate/removebucketoperation.cpp
@@ -39,7 +39,7 @@ RemoveBucketOperation::onStartInternal(DistributorMessageSender& sender)
_ok = true;
if (!getNodes().empty()) {
- _manager->getDistributorComponent().removeNodesFromDB(getBucket(), getNodes());
+ _manager->operation_context().remove_nodes_from_bucket_database(getBucket(), getNodes());
for (uint32_t i = 0; i < msgs.size(); ++i) {
_tracker.queueCommand(msgs[i].second, msgs[i].first);
}
@@ -83,7 +83,7 @@ RemoveBucketOperation::onReceiveInternal(const std::shared_ptr<api::StorageReply
_manager->operation_context().update_bucket_database(
getBucket(),
- BucketCopy(_manager->getDistributorComponent().getUniqueTimestamp(),
+ BucketCopy(_manager->operation_context().generate_unique_timestamp(),
node,
rep->getBucketInfo()),
DatabaseUpdate::CREATE_IF_NONEXISTING);
diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp
index f05feae6dab..d244521140a 100644
--- a/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp
@@ -98,7 +98,7 @@ SetBucketStateOperation::onReceive(DistributorMessageSender& sender,
}
entry->updateNode(
- BucketCopy(_manager->getDistributorComponent().getUniqueTimestamp(),
+ BucketCopy(_manager->operation_context().generate_unique_timestamp(),
node,
bInfo).setTrusted(copy->trusted()));
diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp
index 1e66cc174e0..a75e954c118 100644
--- a/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp
@@ -94,7 +94,7 @@ SplitOperation::onReceive(DistributorMessageSender&, const api::StorageReply::SP
ost << sinfo.first << ",";
BucketCopy copy(
- BucketCopy(_manager->getDistributorComponent().getUniqueTimestamp(),
+ BucketCopy(_manager->operation_context().generate_unique_timestamp(),
node,
sinfo.second));
@@ -111,7 +111,7 @@ SplitOperation::onReceive(DistributorMessageSender&, const api::StorageReply::SP
rep.getResult().getResult() == api::ReturnCode::BUCKET_NOT_FOUND
&& _bucketSpace->getBucketDatabase().get(rep.getBucketId())->getNode(node) != 0)
{
- _manager->getDistributorComponent().recheckBucketInfo(node, getBucket());
+ _manager->operation_context().recheck_bucket_info(node, getBucket());
LOGBP(debug, "Split failed for %s: bucket not found. Storage and "
"distributor bucket databases might be out of sync: %s",
getBucketId().toString().c_str(),
diff --git a/storage/src/vespa/storage/distributor/statechecker.cpp b/storage/src/vespa/storage/distributor/statechecker.cpp
index 3f143908730..bbbe283077f 100644
--- a/storage/src/vespa/storage/distributor/statechecker.cpp
+++ b/storage/src/vespa/storage/distributor/statechecker.cpp
@@ -66,7 +66,7 @@ StateChecker::Context::Context(const DistributorStripeComponent& c,
NodeMaintenanceStatsTracker& statsTracker,
const document::Bucket &bucket_)
: bucket(bucket_),
- siblingBucket(c.getSibling(bucket.getBucketId())),
+ siblingBucket(c.get_sibling(bucket.getBucketId())),
systemState(distributorBucketSpace.getClusterState()),
pending_cluster_state(c.getDistributor().pendingClusterStateOrNull(bucket_.getBucketSpace())),
distributorConfig(c.getDistributor().getConfig()),