aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-12-02 07:37:58 -0800
committerJon Bratseth <bratseth@yahoo-inc.com>2016-12-02 07:37:58 -0800
commitf44fd65a9874c759727e6a75f1364e7a40586277 (patch)
treedd5bd15a5424834fd62fe31a2748b7b46678c127 /config-model
parent3e6a4fcb3e7d17f4808a713fe30011c82b9d63a0 (diff)
Always use 16 distribution bits on hosted systems
This avoids distribution skew with few bits and massive redistribution events when nodes are deactivated after reducing the number of nodes.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java8
-rw-r--r--config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java4
2 files changed, 7 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
index c80d17f8202..1404d3883a9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
@@ -60,7 +60,7 @@ public class ContentCluster extends AbstractConfigProducer implements StorDistri
// TODO: Make private
private String documentSelection;
ContentSearchCluster search;
- final Map<String, NewDocumentType> documentDefinitions;
+ private final Map<String, NewDocumentType> documentDefinitions;
com.yahoo.vespa.model.content.StorageGroup rootGroup;
StorageCluster storageNodes;
DistributorCluster distributorNodes;
@@ -69,6 +69,7 @@ public class ContentCluster extends AbstractConfigProducer implements StorDistri
PersistenceEngine.PersistenceFactory persistenceFactory;
String clusterName;
Integer maxNodesPerMerge;
+ private final boolean hostedVespa;
/**
* If multitenant or a cluster controller was explicitly configured in this cluster:
@@ -462,6 +463,7 @@ public class ContentCluster extends AbstractConfigProducer implements StorDistri
this.documentDefinitions = documentDefinitions;
this.documentSelection = routingSelection;
this.redundancy = redundancy;
+ this.hostedVespa = parent.getRoot().getDeployState().getProperties().hostedVespa();
}
public void prepare() {
@@ -578,13 +580,13 @@ public class ContentCluster extends AbstractConfigProducer implements StorDistri
/**
* Returns the distribution bits this cluster should use.
- * OnHosted Vespa this is hardcoded not computed from the nodes because reducing the number of nodes is a common
+ * On Hosted Vespa this is hardcoded not computed from the nodes because reducing the number of nodes is a common
* operation while reducing the number of distribution bits can lead to consistency problems.
* This hardcoded value should work fine from 1-200 nodes. Those who have more will need to set this value
* in config and not remove it again if they reduce the node count.
*/
public int distributionBits() {
- // if (hostedVespa) return 16; TODO: Re-enable this later (Nov 2015, ref VESPA-1702)
+ if (hostedVespa) return 16;
return DistributionBitCalculator.getDistributionBits(getNodeCountPerGroup(), getDistributionMode());
}
diff --git a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java
index 1d0b4609ec3..90f0d9af4a3 100644
--- a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java
+++ b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java
@@ -457,7 +457,7 @@ public class ModelProvisioningTest {
assertEquals("default12", clusterControllers.getContainers().get(2).getHostName());
assertEquals(0, cluster.getRootGroup().getNodes().size());
assertEquals(8, cluster.getRootGroup().getSubgroups().size());
- assertEquals(8, cluster.distributionBits());
+ assertEquals(16, cluster.distributionBits());
// first group
assertThat(cluster.getRootGroup().getSubgroups().get(0).getIndex(), is("0"));
assertThat(cluster.getRootGroup().getSubgroups().get(0).getNodes().size(), is(1));
@@ -506,7 +506,7 @@ public class ModelProvisioningTest {
// Check content clusters
ContentCluster cluster = model.getContentClusters().get("bar");
ContainerCluster clusterControllers = cluster.getClusterControllers();
- assertEquals( 8, cluster.distributionBits());
+ assertEquals( 16, cluster.distributionBits());
assertEquals("We get the closest odd numer", 5, clusterControllers.getContainers().size());
assertEquals("bar-controllers", clusterControllers.getName());
assertEquals("default10", clusterControllers.getContainers().get(0).getHostName());