summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfig-proxy/src/main/sh/vespa-config-ctl.sh2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java18
-rwxr-xr-xconfigserver/src/main/sh/start-configserver2
-rwxr-xr-xcontainer-disc/src/main/sh/vespa-start-container-daemon.sh2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java2
-rw-r--r--dist/vespa.spec12
-rwxr-xr-xlogserver/bin/logserver-start.sh2
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImpl.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImplTest.java10
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java1
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java5
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java14
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java4
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java4
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java8
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModelTest.java18
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java7
-rw-r--r--standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java2
-rw-r--r--vespabase/CMakeLists.txt2
-rwxr-xr-xvespabase/src/rhel-prestart.sh4
22 files changed, 71 insertions, 56 deletions
diff --git a/config-proxy/src/main/sh/vespa-config-ctl.sh b/config-proxy/src/main/sh/vespa-config-ctl.sh
index 63aaf11280f..be141561b07 100755
--- a/config-proxy/src/main/sh/vespa-config-ctl.sh
+++ b/config-proxy/src/main/sh/vespa-config-ctl.sh
@@ -122,7 +122,7 @@ case $1 in
java ${jvmopts} \
-XX:+ExitOnOutOfMemoryError $(getJavaOptionsIPV46) \
-Dproxyconfigsources="${configsources}" \
- -Djava.io.tmpdir=${VESPA_HOME}/tmp \
+ -Djava.io.tmpdir=${VESPA_HOME}/var/tmp \
${userargs} \
-XX:ActiveProcessorCount=2 \
-cp $cp com.yahoo.vespa.config.proxy.ProxyServer 19090
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
index b36e8d2d37c..d05640ef818 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
@@ -216,19 +216,6 @@ public class SessionRepository {
return List.copyOf(localSessionCache.values());
}
- public Set<LocalSession> getLocalSessionsFromFileSystem() {
- File[] sessions = tenantFileSystemDirs.sessionsPath().listFiles(sessionApplicationsFilter);
- if (sessions == null) return Set.of();
-
- Set<LocalSession> sessionIds = new HashSet<>();
- for (File session : sessions) {
- long sessionId = Long.parseLong(session.getName());
- LocalSession localSession = getSessionFromFile(sessionId);
- sessionIds.add(localSession);
- }
- return sessionIds;
- }
-
private LocalSession getSessionFromFile(long sessionId) {
SessionZooKeeperClient sessionZKClient = createSessionZooKeeperClient(sessionId);
File sessionDir = getAndValidateExistingSessionAppDir(sessionId);
@@ -377,10 +364,7 @@ public class SessionRepository {
}
public int deleteExpiredRemoteSessions(Clock clock) {
- Duration expiryTime = configserverConfig.hostedVespa()
- ? sessionLifetime.multipliedBy(2)
- : sessionLifetime.multipliedBy(12); // TODO: Remove when tested more (Oct. 2022 at the latest)
-
+ Duration expiryTime = sessionLifetime.multipliedBy(2);
List<Long> remoteSessionsFromZooKeeper = getRemoteSessionsFromZooKeeper();
log.log(Level.FINE, () -> "Remote sessions for tenant " + tenantName + ": " + remoteSessionsFromZooKeeper);
diff --git a/configserver/src/main/sh/start-configserver b/configserver/src/main/sh/start-configserver
index 8f515a4c309..97ccae9125f 100755
--- a/configserver/src/main/sh/start-configserver
+++ b/configserver/src/main/sh/start-configserver
@@ -182,7 +182,7 @@ vespa-run-as-vespa-user vespa-runserver -s ${VESPA_SERVICE_NAME} -r 30 -p $pidfi
--add-opens=java.base/java.nio=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED \
--add-opens=java.base/sun.security.ssl=ALL-UNNAMED \
- -Djava.io.tmpdir=${VESPA_HOME}/tmp \
+ -Djava.io.tmpdir=${VESPA_HOME}/var/tmp \
-Djava.library.path=${VESPA_HOME}/lib64 \
-Djava.security.properties=${VESPA_HOME}/conf/vespa/java.security.override \
-Djava.awt.headless=true \
diff --git a/container-disc/src/main/sh/vespa-start-container-daemon.sh b/container-disc/src/main/sh/vespa-start-container-daemon.sh
index 09a873f06f9..bd218ba176d 100755
--- a/container-disc/src/main/sh/vespa-start-container-daemon.sh
+++ b/container-disc/src/main/sh/vespa-start-container-daemon.sh
@@ -274,7 +274,7 @@ exec $numactlcmd $envcmd java \
--add-opens=java.base/java.nio=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED \
--add-opens=java.base/sun.security.ssl=ALL-UNNAMED \
- -Djava.io.tmpdir="${VESPA_HOME}/tmp" \
+ -Djava.io.tmpdir="${VESPA_HOME}/var/tmp" \
-Djava.library.path="${VESPA_HOME}/lib64" \
-Djava.security.properties=${VESPA_HOME}/conf/vespa/java.security.override \
-Djava.awt.headless=true \
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
index e8c92d3e3f6..e6d793affff 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
@@ -248,7 +248,9 @@ public class InternalStepRunner implements StepRunner {
}
case LOAD_BALANCER_NOT_READY, PARENT_HOST_NOT_READY -> {
logger.log(e.message()); // Consider splitting these messages in summary and details, on config server.
- controller.jobController().locked(id, run -> run.sleepingUntil(startTime.plusSeconds(300)));
+ Instant someTimeAfterStart = startTime.plusSeconds(450);
+ Instant inALittleWhile = controller.clock().instant().plusSeconds(90);
+ controller.jobController().locked(id, run -> run.sleepingUntil(someTimeAfterStart.isAfter(inALittleWhile) ? someTimeAfterStart : inALittleWhile));
return result;
}
case NODE_ALLOCATION_FAILURE -> {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java
index 9bea7fb829d..4f4e21d9f25 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java
@@ -58,7 +58,7 @@ import static com.yahoo.yolean.Exceptions.uncheck;
public class ConfigServerRestExecutorImpl extends AbstractComponent implements ConfigServerRestExecutor {
private static final Logger LOG = Logger.getLogger(ConfigServerRestExecutorImpl.class.getName());
- private static final Duration PROXY_REQUEST_TIMEOUT = Duration.ofSeconds(10);
+ private static final Duration PROXY_REQUEST_TIMEOUT = Duration.ofSeconds(20);
private static final Duration PING_REQUEST_TIMEOUT = Duration.ofMillis(500);
private static final Duration SINGLE_TARGET_WAIT = Duration.ofSeconds(2);
private static final int SINGLE_TARGET_RETRIES = 3;
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java
index 9bf762d2f99..2f245ab9736 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java
@@ -516,7 +516,7 @@ public class InternalStepRunnerTest {
assertEquals(oldTrusted, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());
tester.configServer().throwOnNextPrepare(null);
- tester.clock().advance(Duration.ofSeconds(300));
+ tester.clock().advance(Duration.ofSeconds(450));
tester.runner().run();
assertEquals(succeeded, tester.jobs().run(id).stepStatuses().get(Step.deployTester));
assertEquals(succeeded, tester.jobs().run(id).stepStatuses().get(Step.deployReal));
diff --git a/dist/vespa.spec b/dist/vespa.spec
index 437daf3f4e2..2592e769359 100644
--- a/dist/vespa.spec
+++ b/dist/vespa.spec
@@ -586,6 +586,10 @@ exit 0
%systemd_postun_with_restart vespa-configserver.service
%endif
+%post base
+
+ln -sf %{_prefix}/var/tmp %{_prefix}/tmp
+
%postun base
if [ $1 -eq 0 ]; then # this is an uninstallation
rm -f /etc/profile.d/vespa.sh
@@ -603,6 +607,10 @@ then
mv %{_prefix}/conf/vespa/default-env.txt.rpmsave %{_prefix}/conf/vespa/default-env.txt
fi
fi
+if test -L %{_prefix}/tmp
+then
+ rm -f %{_prefix}/tmp
+fi
%files
%if %{_defattr_is_vespa_vespa}
@@ -690,8 +698,6 @@ fi
%{_prefix}/man
%{_prefix}/sbin
%{_prefix}/share
-%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/tmp
-%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/tmp/vespa
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/crash
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/db
@@ -707,6 +713,8 @@ fi
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/db/vespa/tmp
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/jdisc_container
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/run
+%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/tmp
+%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/tmp/vespa
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/vespa
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/vespa/application
%dir %attr(-,%{_vespa_user},%{_vespa_group}) %{_prefix}/var/vespa/bundlecache
diff --git a/logserver/bin/logserver-start.sh b/logserver/bin/logserver-start.sh
index d37a2f31720..942120ceb21 100755
--- a/logserver/bin/logserver-start.sh
+++ b/logserver/bin/logserver-start.sh
@@ -81,7 +81,7 @@ cd ${VESPA_HOME} || { echo "Cannot cd to ${VESPA_HOME}" 1>&2; exit 1; }
heap_min=32
heap_max=256
-addopts="-server -Xms${heap_min}m -Xmx${heap_max}m -XX:+PreserveFramePointer $(get_jvm_hugepage_settings $heap_max) -XX:CompressedClassSpaceSize=32m -XX:MaxDirectMemorySize=32m -XX:ThreadStackSize=448 -XX:MaxJavaStackTraceDepth=1000 -XX:ActiveProcessorCount=2 -XX:-OmitStackTraceInFastThrow -Djava.io.tmpdir=${VESPA_HOME}/tmp"
+addopts="-server -Xms${heap_min}m -Xmx${heap_max}m -XX:+PreserveFramePointer $(get_jvm_hugepage_settings $heap_max) -XX:CompressedClassSpaceSize=32m -XX:MaxDirectMemorySize=32m -XX:ThreadStackSize=448 -XX:MaxJavaStackTraceDepth=1000 -XX:ActiveProcessorCount=2 -XX:-OmitStackTraceInFastThrow -Djava.io.tmpdir=${VESPA_HOME}/var/tmp"
oomopt="-XX:+ExitOnOutOfMemoryError"
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImpl.java
index 3a0cd412a2e..43b4df7415e 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImpl.java
@@ -98,7 +98,7 @@ public class VespaServiceDumperImpl implements VespaServiceDumper {
handleFailure(context, request, startedAt, "No artifacts requested");
return;
}
- ContainerPath directory = context.paths().underVespaHome("tmp/vespa-service-dump-" + request.getCreatedMillisOrNull());
+ ContainerPath directory = context.paths().underVespaHome("var/tmp/vespa-service-dump-" + request.getCreatedMillisOrNull());
UnixPath unixPathDirectory = new UnixPath(directory);
try {
context.log(log, Level.INFO,
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImplTest.java
index 081f0038e06..5366156cfbe 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImplTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/servicedump/VespaServiceDumperImplTest.java
@@ -44,7 +44,7 @@ class VespaServiceDumperImplTest {
private static final String HOSTNAME = "host-1.domain.tld";
private final FileSystem fileSystem = TestFileSystem.create();
- private final Path tmpDirectory = fileSystem.getPath("/data/vespa/storage/host-1/opt/vespa/tmp");
+ private final Path tmpDirectory = fileSystem.getPath("/data/vespa/storage/host-1/opt/vespa/var/tmp");
@BeforeEach
void create_tmp_directory() throws IOException {
@@ -84,11 +84,11 @@ class VespaServiceDumperImplTest {
verify(operations).executeCommandInContainer(
context, context.users().vespa(), "/opt/vespa/libexec/vespa/find-pid", "default/container.1");
verify(operations).executeCommandInContainer(
- context, context.users().vespa(), "perf", "record", "-g", "--output=/opt/vespa/tmp/vespa-service-dump-1600000000000/perf-record.bin",
+ context, context.users().vespa(), "perf", "record", "-g", "--output=/opt/vespa/var/tmp/vespa-service-dump-1600000000000/perf-record.bin",
"--pid=12345", "sleep", "45");
verify(operations).executeCommandInContainer(
- context, context.users().vespa(), "bash", "-c", "perf report --input=/opt/vespa/tmp/vespa-service-dump-1600000000000/perf-record.bin" +
- " > /opt/vespa/tmp/vespa-service-dump-1600000000000/perf-report.txt");
+ context, context.users().vespa(), "bash", "-c", "perf report --input=/opt/vespa/var/tmp/vespa-service-dump-1600000000000/perf-record.bin" +
+ " > /opt/vespa/var/tmp/vespa-service-dump-1600000000000/perf-report.txt");
String expectedJson = "{\"createdMillis\":1600000000000,\"startedAt\":1600001000000,\"completedAt\":1600001000000," +
"\"location\":\"s3://uri-1/tenant1/service-dump/default-container-1-1600000000000/\"," +
@@ -127,7 +127,7 @@ class VespaServiceDumperImplTest {
context, context.users().vespa(), "/opt/vespa/libexec/vespa/find-pid", "default/container.1");
verify(operations).executeCommandInContainer(
context, context.users().vespa(), "jcmd", "12345", "JFR.start", "name=host-admin", "path-to-gc-roots=true", "settings=profile",
- "filename=/opt/vespa/tmp/vespa-service-dump-1600000000000/recording.jfr", "duration=30s");
+ "filename=/opt/vespa/var/tmp/vespa-service-dump-1600000000000/recording.jfr", "duration=30s");
verify(operations).executeCommandInContainer(context, context.users().vespa(), "jcmd", "12345", "JFR.check", "name=host-admin");
String expectedJson = "{\"createdMillis\":1600000000000,\"startedAt\":1600001000000," +
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java
index 768036fd284..de1f9e65415 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java
@@ -118,7 +118,6 @@ public final class Node implements Nodelike {
if (!ipConfig.pool().ipSet().isEmpty()) throw new IllegalArgumentException("A child node cannot have an IP address pool");
if (modelName.isPresent()) throw new IllegalArgumentException("A child node cannot have model name set");
if (switchHostname.isPresent()) throw new IllegalArgumentException("A child node cannot have switch hostname set");
- if (!cloudAccount.isEmpty()) throw new IllegalArgumentException("A child node cannot have cloud account set");
}
if (type != NodeType.host && reservedTo.isPresent())
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java
index 3025124b174..22a6a5812b2 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java
@@ -225,15 +225,14 @@ public class ClusterModel {
growthRateHeadroom = Math.min(growthRateHeadroom, 1 / queryFractionOfMax() + 0.1);
// How much headroom is needed to handle sudden arrival of additional traffic due to another zone going down?
- double maxTrafficShiftHeadroom = 10.0; // Cap to avoid extreme sizes from a current very small share
double trafficShiftHeadroom;
if (application.status().maxReadShare() == 0) // No traffic fraction data
trafficShiftHeadroom = 2.0; // assume we currently get half of the global share of traffic
else if (application.status().currentReadShare() == 0)
- trafficShiftHeadroom = maxTrafficShiftHeadroom;
+ trafficShiftHeadroom = 1/application.status().maxReadShare();
else
trafficShiftHeadroom = application.status().maxReadShare() / application.status().currentReadShare();
- trafficShiftHeadroom = Math.min(trafficShiftHeadroom, maxTrafficShiftHeadroom);
+ trafficShiftHeadroom = Math.min(trafficShiftHeadroom, 1/application.status().maxReadShare());
// Assumptions: 1) Write load is not organic so we should not grow to handle more.
// (TODO: But allow applications to set their target write rate and size for that)
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java
index 7947fe9f021..c2a6e4658f3 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Activator.java
@@ -3,6 +3,7 @@ package com.yahoo.vespa.hosted.provision.provisioning;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.ApplicationTransaction;
+import com.yahoo.config.provision.CloudAccount;
import com.yahoo.config.provision.ClusterMembership;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.Flavor;
@@ -88,7 +89,8 @@ class Activator {
NodeList activeToRemove = oldActive.matching(node -> ! hostnames.contains(node.hostname()));
remove(activeToRemove, transaction); // TODO: Pass activation time in this call and next line
- nodeRepository.nodes().activate(newActive.asList(), transaction.nested()); // activate also continued active to update node state
+ // TODO (freva): Replace .mapToList(...) with .asList() after 8.80
+ nodeRepository.nodes().activate(newActive.mapToList(node -> fixCloudAccount(node, allNodes)), transaction.nested()); // activate also continued active to update node state
rememberResourceChange(transaction, generation, activationTime,
oldActive.not().retired(),
@@ -248,4 +250,14 @@ class Activator {
return null;
}
+ private Node fixCloudAccount(Node node, NodeList allNodes) {
+ // Existing nodes do not have cloudAccount set, copy the one from parent
+ CloudAccount cloudAccount = allNodes.parentOf(node).map(Node::cloudAccount).orElseGet(node::cloudAccount);
+ return new Node(node.id(), node.ipConfig(), node.hostname(),
+ node.parentHostname(), node.flavor(), node.status(), node.state(), node.allocation(), node.history(),
+ node.type(), node.reports(), node.modelName(), node.reservedTo(),
+ node.exclusiveToApplicationId(), node.exclusiveToClusterType(), node.switchHostname(),
+ node.trustedCertificates(), cloudAccount);
+ }
+
}
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java
index 8e13ac65c21..b1b230479ee 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java
@@ -430,7 +430,9 @@ public abstract class NodeCandidate implements Nodelike, Comparable<NodeCandidat
resources.with(parent.get().resources().diskSpeed())
.with(parent.get().resources().storageType())
.with(parent.get().resources().architecture()),
- NodeType.tenant).build();
+ NodeType.tenant)
+ .cloudAccount(parent.get().cloudAccount())
+ .build();
return new ConcreteNodeCandidate(node, freeParentCapacity, parent, violatesSpares, exclusiveSwitch, isSurplus, isNew, isResizable);
}
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java
index 35b80459168..15a6b6ba523 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisionedHost.java
@@ -74,7 +74,9 @@ public class ProvisionedHost {
/** Generate {@link Node} instance representing the node running on this physical host */
public Node generateNode() {
- return Node.reserve(Set.of(), nodeHostname(), hostHostname, nodeResources, hostType.childNodeType()).build();
+ return Node.reserve(Set.of(), nodeHostname(), hostHostname, nodeResources, hostType.childNodeType())
+ .cloudAccount(cloudAccount)
+ .build();
}
public String getId() { return id; }
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java
index 04cbdd2666d..25c5b772655 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java
@@ -113,16 +113,16 @@ public class AutoscalingTest {
@Test
public void test_autoscaling_without_traffic() {
- var min = new ClusterResources(1, 1, new NodeResources(2, 4, 10, 0.3));
- var now = new ClusterResources(4, 1, new NodeResources(2, 16, 10, 0.3));
- var max = new ClusterResources(4, 1, new NodeResources(3, 16, 50, 0.3));
+ var min = new ClusterResources(1, 1, new NodeResources(0.5, 4, 10, 0.3));
+ var now = new ClusterResources(4, 1, new NodeResources(8, 16, 10, 0.3));
+ var max = new ClusterResources(4, 1, new NodeResources(16, 32, 50, 0.3));
var fixture = AutoscalingTester.fixture(min, now, max)
.clusterType(ClusterSpec.Type.container)
.awsProdSetup()
.build();
var duration = fixture.loader().addMeasurements(new Load(0.04, 0.39, 0.01), 20);
fixture.tester().clock().advance(duration.negated());
- fixture.loader().zeroTraffic(20);
+ fixture.loader().zeroTraffic(20, 1);
fixture.tester().assertResources("Scaled down",
2, 1, 2, 16, 10,
fixture.autoscale());
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModelTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModelTest.java
index 0559a232065..f31ad191637 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModelTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModelTest.java
@@ -41,25 +41,30 @@ public class ClusterModelTest {
// No current traffic share: Ideal load is low but capped
var model1 = clusterModel(new Status(0.0, 1.0),
t -> t == 0 ? 10000.0 : 0.0, t -> 0.0);
- assertEquals(0.10672097759674132, model1.idealLoad().cpu(), delta);
+ assertEquals(0.37067209775967414, model1.idealLoad().cpu(), delta);
// Almost no current traffic share: Ideal load is low but capped
var model2 = clusterModel(new Status(0.0001, 1.0),
t -> t == 0 ? 10000.0 : 0.0, t -> 0.0);
- assertEquals(0.10672097759674132, model2.idealLoad().cpu(), delta);
+ assertEquals(0.37067209775967414, model2.idealLoad().cpu(), delta);
}
@Test
public void test_growth_headroom() {
- // No current traffic: Ideal load is low but capped
+ // No traffic data: Ideal load assumes 2 regions
var model1 = clusterModel(new Status(0.0, 0.0),
t -> t == 0 ? 10000.0 : 0.0, t -> 0.0);
assertEquals(0.2240325865580448, model1.idealLoad().cpu(), delta);
- // Almost no current traffic: Ideal load is low but capped
- var model2 = clusterModel(new Status(0.0001, 1.0),
+ // No traffic: Ideal load is higher since we now know there is only one zone
+ var model2 = clusterModel(new Status(0.0, 1.0),
+ t -> t == 0 ? 10000.0 : 0.0, t -> 0.0);
+ assertEquals(0.37067209775967414, model2.idealLoad().cpu(), delta);
+
+ // Almost no current traffic: Similar number as above
+ var model3 = clusterModel(new Status(0.0001, 1.0),
t -> t == 0 ? 10000.0 : 0.0001, t -> 0.0);
- assertEquals(0.0326530612244898, model2.idealLoad().cpu(), delta);
+ assertEquals(0.32653061224489793, model3.idealLoad().cpu(), delta);
}
private ClusterModel clusterModelWithNoData() {
@@ -72,7 +77,6 @@ public class ClusterModelTest {
ClusterSpec clusterSpec = clusterSpec();
Cluster cluster = cluster(resources());
application = application.with(cluster);
-
return new ClusterModel(application.with(status),
clusterSpec, cluster, clock, Duration.ofMinutes(10),
timeseries(cluster,100, queryRate, writeRate, clock),
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java
index 39745b726a0..9158262b134 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java
@@ -26,9 +26,12 @@ public class Loader {
}
/** Assign measured zero traffic in the same way as the system will. */
- public Duration zeroTraffic(int measurements) {
+ public Duration zeroTraffic(int measurements, int prodRegions) {
try (var lock = fixture.tester().nodeRepository().applications().lock(fixture.applicationId())) {
- var statusWithZeroLoad = fixture.application().status().withCurrentReadShare(0).withMaxReadShare(1);
+ var statusWithZeroLoad = fixture.application().status()
+ .withCurrentReadShare(0)
+ // the line below from TrafficShareUpdater
+ .withMaxReadShare(prodRegions < 2 ? 1.0 : 1.0 / ( prodRegions - 1.0));
fixture.tester().nodeRepository().applications().put(fixture.application().with(statusWithZeroLoad), lock);
}
return addQueryRateMeasurements(measurements, (n) -> 0.0);
diff --git a/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java b/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java
index a677c69cb79..f80cdbed900 100644
--- a/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java
+++ b/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java
@@ -67,7 +67,7 @@ public class StandaloneContainerApplication implements Application {
public static final Named APPLICATION_PATH_NAME = Names.named(APPLICATION_LOCATION_INSTALL_VARIABLE);
public static final Named CONFIG_MODEL_REPO_NAME = Names.named("ConfigModelRepo");
- private static final String DEFAULT_TMP_BASE_DIR = Defaults.getDefaults().underVespaHome("tmp");
+ private static final String DEFAULT_TMP_BASE_DIR = Defaults.getDefaults().underVespaHome("var/tmp");
private static final String TMP_DIR_NAME = "standalone_container";
private static final StaticConfigDefinitionRepo configDefinitionRepo = new StaticConfigDefinitionRepo();
diff --git a/vespabase/CMakeLists.txt b/vespabase/CMakeLists.txt
index ce19dbb56b3..e72f02d5eeb 100644
--- a/vespabase/CMakeLists.txt
+++ b/vespabase/CMakeLists.txt
@@ -23,7 +23,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/conf/default-env.txt DESTINATION conf/
install(DIRECTORY DESTINATION logs/vespa)
install(DIRECTORY DESTINATION logs/vespa/access)
-install(DIRECTORY DESTINATION tmp/vespa)
install(DIRECTORY DESTINATION var/crash)
install(DIRECTORY DESTINATION var/db/vespa)
install(DIRECTORY DESTINATION var/db/vespa/config_server)
@@ -36,6 +35,7 @@ install(DIRECTORY DESTINATION var/db/vespa/search)
install(DIRECTORY DESTINATION var/db/vespa/tmp)
install(DIRECTORY DESTINATION var/jdisc_container)
install(DIRECTORY DESTINATION var/run)
+install(DIRECTORY DESTINATION var/tmp/vespa)
install(DIRECTORY DESTINATION var/vespa)
install(DIRECTORY DESTINATION var/vespa/application)
install(DIRECTORY DESTINATION var/vespa/bundlecache)
diff --git a/vespabase/src/rhel-prestart.sh b/vespabase/src/rhel-prestart.sh
index d6f53046b47..358e9ceccdb 100755
--- a/vespabase/src/rhel-prestart.sh
+++ b/vespabase/src/rhel-prestart.sh
@@ -124,8 +124,6 @@ fixdir ${VESPA_USER} ${VESPA_GROUP} 755 logs/vespa
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 logs/vespa/access
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 logs/vespa/configserver
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 logs/vespa/search
-fixdir ${VESPA_USER} ${VESPA_GROUP} 755 tmp
-fixdir ${VESPA_USER} ${VESPA_GROUP} 755 tmp/vespa
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/crash
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/db
@@ -141,6 +139,8 @@ fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/db/vespa/search
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/db/vespa/tmp
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/jdisc_container
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/run
+fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/tmp
+fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/tmp/vespa
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/vespa
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/vespa/application
fixdir ${VESPA_USER} ${VESPA_GROUP} 755 var/vespa/bundlecache