summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java16
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java1
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java8
4 files changed, 23 insertions, 6 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
index 16b7894211e..6dc4b1e8015 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
@@ -74,6 +74,7 @@ public class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAd
private boolean processingCycle = false;
private boolean wantedStateChanged = false;
private long cycleCount = 0;
+ private long lastMetricUpdateCycleCount = 0;
private long nextStateSendTime = 0;
private Long controllerThreadId = null;
@@ -384,6 +385,7 @@ public class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAd
ClusterState baselineState = stateBundle.getBaselineClusterState();
newStates.add(stateBundle);
metricUpdater.updateClusterStateMetrics(cluster, baselineState);
+ lastMetricUpdateCycleCount = cycleCount;
systemStateBroadcaster.handleNewClusterStates(stateBundle);
// Iff master, always store new version in ZooKeeper _before_ publishing to any
// nodes so that a cluster controller crash after publishing but before a successful
@@ -393,6 +395,19 @@ public class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAd
}
}
+ private boolean maybePublishOldMetrics() {
+ verifyInControllerThread();
+ if (cycleCount > 300 + lastMetricUpdateCycleCount) {
+ ClusterStateBundle stateBundle = stateVersionTracker.getVersionedClusterStateBundle();
+ ClusterState baselineState = stateBundle.getBaselineClusterState();
+ metricUpdater.updateClusterStateMetrics(cluster, baselineState);
+ lastMetricUpdateCycleCount = cycleCount;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
private void storeClusterStateMetaDataToZooKeeper(ClusterStateBundle stateBundle) {
try {
database.saveLatestSystemStateVersion(databaseContext, stateBundle.getVersion());
@@ -605,6 +620,7 @@ public class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAd
if ( ! isRunning()) { return; }
didWork |= processNextQueuedRemoteTask();
didWork |= completeSatisfiedVersionDependentTasks();
+ didWork |= maybePublishOldMetrics();
processingCycle = false;
++cycleCount;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java
index 3e2adeaacc9..a0b99516ce3 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java
@@ -97,6 +97,7 @@ public class MetricsProxyContainerCluster extends ContainerCluster<MetricsProxyC
addPlatformBundle(METRICS_PROXY_BUNDLE_FILE);
addClusterComponents();
+ setJvmGCOptions(deployState.getProperties().jvmGCOptions());
}
private void addClusterComponents() {
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java
index 34f06519ac9..c71bbc6d89c 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java
@@ -23,9 +23,9 @@ import com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyContainerCluster.App
import com.yahoo.vespa.model.container.component.Component;
import com.yahoo.vespa.model.container.component.Handler;
import org.junit.Test;
-
import java.util.Collection;
+import static com.yahoo.vespa.model.container.ContainerCluster.G1GC;
import static com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyContainerCluster.METRICS_PROXY_BUNDLE_FILE;
import static com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyContainerCluster.zoneString;
import static com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyModelTester.CLUSTER_CONFIG_ID;
@@ -81,7 +81,7 @@ public class MetricsProxyContainerClusterTest {
assertEquals(0, qrStartConfig.jvm().heapSizeAsPercentageOfPhysicalMemory());
assertEquals(2, qrStartConfig.jvm().availableProcessors());
assertFalse(qrStartConfig.jvm().verbosegc());
- assertEquals("-XX:+UseG1GC -XX:MaxTenuringThreshold=15", qrStartConfig.jvm().gcopts());
+ assertEquals(G1GC, qrStartConfig.jvm().gcopts());
assertEquals(512, qrStartConfig.jvm().stacksize());
assertEquals(0, qrStartConfig.jvm().directMemorySizeCache());
assertEquals(32, qrStartConfig.jvm().compressedClassSpaceSize());
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java
index 7aab759f676..15136ed79eb 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java
@@ -56,7 +56,7 @@ public class NodeVersion {
/** Returns the duration of the change in this, measured relative to instant */
public Duration changeDuration(Instant instant) {
- if (!changing()) return Duration.ZERO;
+ if (!upgrading()) return Duration.ZERO;
if (suspendedAt.isEmpty()) return Duration.ZERO; // Node hasn't suspended to apply the change yet
return Duration.between(suspendedAt.get(), instant).abs();
}
@@ -88,9 +88,9 @@ public class NodeVersion {
return Objects.hash(hostname, zone, currentVersion, wantedVersion, suspendedAt);
}
- /** Returns whether this is changing (upgrading or downgrading) */
- private boolean changing() {
- return !currentVersion.equals(wantedVersion);
+ /** Returns whether this is upgrading */
+ private boolean upgrading() {
+ return currentVersion.isBefore(wantedVersion);
}
}