summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-09-04 19:46:42 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-09-04 19:46:42 +0000
commit74da981873dc8be1d02f2466e27d7f262071715d (patch)
tree70f6903b09dd77d0209aa4824a671fc450dbd708 /storage
parent54ef666d30f8486e56382dc7962ff524962578e8 (diff)
Move shouldSkipActivationDueToMaintenance to anonymous namespace
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/distributor/statecheckers.cpp18
-rw-r--r--storage/src/vespa/storage/distributor/statecheckers.h1
2 files changed, 11 insertions, 8 deletions
diff --git a/storage/src/vespa/storage/distributor/statecheckers.cpp b/storage/src/vespa/storage/distributor/statecheckers.cpp
index 478faa38232..d3d215c31d6 100644
--- a/storage/src/vespa/storage/distributor/statecheckers.cpp
+++ b/storage/src/vespa/storage/distributor/statecheckers.cpp
@@ -938,17 +938,18 @@ DeleteExtraCopiesStateChecker::check(Context& c) const
return Result::noMaintenanceNeeded();
}
+namespace {
+
bool
-BucketStateStateChecker::shouldSkipActivationDueToMaintenance(const ActiveList& activeNodes, const Context& c)
-{
+shouldSkipActivationDueToMaintenance(const ActiveList &activeNodes, const StateChecker::Context &c) {
for (uint32_t i = 0; i < activeNodes.size(); ++i) {
const auto node_index = activeNodes[i].nodeIndex();
- const BucketCopy* cp(c.entry->getNode(node_index));
+ const BucketCopy *cp(c.entry->getNode(node_index));
if (!cp || cp->active()) {
continue;
}
if (!cp->ready()) {
- if (!c.op_ctx.node_supported_features_repo().node_supported_features(node_index).no_implicit_indexing_of_active_buckets) {
+ if (!c.op_ctx.node_supported_features_repo().node_supported_features(node_index).no_implicit_indexing_of_active_buckets)b{
// If copy is not ready, we don't want to activate it if a node
// is set in maintenance. Doing so would imply that we want proton
// to start background indexing.
@@ -959,6 +960,8 @@ BucketStateStateChecker::shouldSkipActivationDueToMaintenance(const ActiveList&
return false;
}
+}
+
/**
* The copy we want to set active is, in prioritized order:
* 1. The first ideal state copy that is trusted and ready
@@ -993,12 +996,13 @@ BucketStateStateChecker::check(Context& c) const
vespalib::asciistream reason;
std::vector<uint16_t> operationNodes;
for (uint32_t i=0; i<activeNodes.size(); ++i) {
- const BucketCopy* cp = c.entry->getNode(activeNodes[i].nodeIndex());
+ const ActiveCopy & active = activeNodes[i];
+ const BucketCopy* cp = c.entry->getNode(active.nodeIndex());
if (cp == nullptr || cp->active()) {
continue;
}
- operationNodes.push_back(activeNodes[i].nodeIndex());
- reason << "[Setting node " << activeNodes[i].nodeIndex() << " as active: " << activeNodes[i].getReason() << "]";
+ operationNodes.push_back(active.nodeIndex());
+ reason << "[Setting node " << active.nodeIndex() << " as active: " << active.getReason() << "]";
}
// Deactivate all copies that are currently marked as active.
diff --git a/storage/src/vespa/storage/distributor/statecheckers.h b/storage/src/vespa/storage/distributor/statecheckers.h
index b6cd5ba0534..88cf8e9712a 100644
--- a/storage/src/vespa/storage/distributor/statecheckers.h
+++ b/storage/src/vespa/storage/distributor/statecheckers.h
@@ -75,7 +75,6 @@ class ActiveList;
class BucketStateStateChecker : public StateChecker
{
- static bool shouldSkipActivationDueToMaintenance(const ActiveList& activeList, const Context& c);
public:
Result check(Context& c) const override;
const char* getName() const noexcept override { return "SetBucketState"; }