diff options
author | Håkon Hallingstad <hakon@verizonmedia.com> | 2020-01-17 12:39:12 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@verizonmedia.com> | 2020-01-17 12:39:12 +0100 |
commit | c28f13dac59167dee1257f5b23835e6441bc5f31 (patch) | |
tree | 7910cb0ce12e37b7af828c3b13c14b84cbcb0105 /clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java | |
parent | b324c19e007a7a57ba731ed72a01d35cd6937ed7 (diff) |
Use bucket_space metric in retirement
This makes the Cluster Controller use the
vds.datastored.bucket_space.buckets_total, dimension bucketSpace=default, to
determine whether a content node manages zero buckets, and if so, will allow
the node to go permanently down. This is used when a node is retiring, and it
is to be removed from the application.
The change is guarded by the use-bucket-space-metric, default true. If the new
metric doesn't work as expected, we can revert to using the current/old metric
by flipping the flag. The flag can be controlled per application.
Diffstat (limited to 'clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java')
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java index ddb9357f11f..ae12a6dabb1 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java @@ -22,6 +22,7 @@ public class ContentCluster { private final ClusterInfo clusterInfo = new ClusterInfo(); private final Map<Node, Long> nodeStartTimestamps = new TreeMap<>(); + private final boolean determineBucketsFromBucketSpaceMetric; private int slobrokGenerationCount = 0; @@ -32,7 +33,9 @@ public class ContentCluster { private double minRatioOfStorageNodesUp; public ContentCluster(String clusterName, Collection<ConfiguredNode> configuredNodes, Distribution distribution, - int minStorageNodesUp, double minRatioOfStorageNodesUp) { + int minStorageNodesUp, double minRatioOfStorageNodesUp, + boolean determineBucketsFromBucketSpaceMetric) { + this.determineBucketsFromBucketSpaceMetric = determineBucketsFromBucketSpaceMetric; if (configuredNodes == null) throw new IllegalArgumentException("Nodes must be set"); this.clusterName = clusterName; this.distribution = distribution; @@ -183,7 +186,8 @@ public class ContentCluster { minStorageNodesUp, minRatioOfStorageNodesUp, distribution.getRedundancy(), - clusterInfo); + clusterInfo, + determineBucketsFromBucketSpaceMetric); return nodeStateChangeChecker.evaluateTransition(node, clusterState, condition, oldState, newState); } |