aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/Flags.java6
-rw-r--r--metrics-proxy/src/main/java/ai/vespa/metricsproxy/service/ConfigSentinelClient.java44
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApi.java50
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java58
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java23
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImplTest.java2
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp18
-rw-r--r--searchcore/src/vespa/searchcore/config/proton.def12
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp10
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.h13
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp9
-rw-r--r--searchlib/src/vespa/searchlib/attribute/address_space_usage.h2
15 files changed, 142 insertions, 115 deletions
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
index a9d918aec7f..2e05bbf5d90 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
@@ -152,6 +152,12 @@ public class Flags {
"Use a new algorithm to calculate the spare disks of a host.",
"Takes effect on first run of DiskTask, typically after host-admin restart/upgrade.");
+ public static final UnboundBooleanFlag LOCAL_SUSPEND = defineFeatureFlag(
+ "local-suspend", true,
+ List.of("hakonhall"), "2021-09-21", "2021-10-21",
+ "Whether the cfghost host admin should suspend against only the local cfg (true and legacy) or all.",
+ "Takes effect immediately.");
+
public static final UnboundBooleanFlag USE_UNKNOWN_SERVICE_STATUS = defineFeatureFlag(
"use-unknown-service-status", true,
List.of("hakonhall"), "2021-09-13", "2021-10-13",
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/service/ConfigSentinelClient.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/service/ConfigSentinelClient.java
index d07a52f42bd..3d834106ebc 100644
--- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/service/ConfigSentinelClient.java
+++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/service/ConfigSentinelClient.java
@@ -24,7 +24,9 @@ import java.util.logging.Logger;
public class ConfigSentinelClient extends AbstractComponent {
private final static Logger log = Logger.getLogger(ConfigSentinelClient.class.getName());
+ private static final Spec SPEC = new Spec("localhost", 19097);
private final Supervisor supervisor;
+ private Target connection = null;
@Inject
public ConfigSentinelClient() {
@@ -33,6 +35,12 @@ public class ConfigSentinelClient extends AbstractComponent {
@Override
public void deconstruct() {
+ synchronized (this) {
+ if (connection != null) {
+ connection.close();
+ connection = null;
+ }
+ }
supervisor.transport().shutdown().join();
super.deconstruct();
}
@@ -126,7 +134,7 @@ public class ConfigSentinelClient extends AbstractComponent {
}
for (int i = 1; i < parts.length; i++) {
- String keyValue[] = parts[i].split("=");
+ String [] keyValue = parts[i].split("=");
String key = keyValue[0];
String value = keyValue[1];
@@ -155,26 +163,24 @@ public class ConfigSentinelClient extends AbstractComponent {
String sentinelLs() {
String servicelist = "";
- int rpcPort = 19097;
- Spec spec = new Spec("localhost", rpcPort);
- Target connection = supervisor.connect(spec);
- try {
- if (connection.isValid()) {
- Request req = new Request("sentinel.ls");
- connection.invokeSync(req, 5.0);
- if (req.errorCode() == ErrorCode.NONE &&
- req.checkReturnTypes("s"))
- {
- servicelist = req.returnValues().get(0).asString();
- } else {
- log.log(Level.WARNING, "Bad answer to RPC request: " + req.errorMessage());
- }
+ synchronized (this) {
+ if (connection == null || ! connection.isValid()) {
+ connection = supervisor.connect(SPEC);
+ }
+ }
+ if (connection.isValid()) {
+ Request req = new Request("sentinel.ls");
+ connection.invokeSync(req, 5.0);
+ if (req.errorCode() == ErrorCode.NONE &&
+ req.checkReturnTypes("s"))
+ {
+ servicelist = req.returnValues().get(0).asString();
} else {
- log.log(Level.WARNING, "Could not connect to sentinel at: "+spec);
+ log.log(Level.WARNING, "Bad answer to RPC request: " + req.errorMessage());
}
- return servicelist;
- } finally {
- connection.close();
+ } else {
+ log.log(Level.WARNING, "Could not connect to sentinel at: " + SPEC);
}
+ return servicelist;
}
}
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApi.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApi.java
index 90768facf34..87e2f6db761 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApi.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApi.java
@@ -10,41 +10,65 @@ import java.util.Optional;
* @author freva
*/
public interface ConfigServerApi extends AutoCloseable {
- class Params {
- private Optional<Duration> connectionTimeout;
+
+ /**
+ * The result of sending a request to a config server results in a jackson response or exception. If a response
+ * is returned, an instance of this interface is conferred to discard the result and try the next config server,
+ * unless it was the last attempt.
+ *
+ * @param <T> the type of the returned jackson response
+ */
+ interface RetryPolicy<T> {
+ boolean tryNextConfigServer(T response);
+ }
+
+ class Params<T> {
+ private Optional<Duration> connectionTimeout = Optional.empty();
+
+ private RetryPolicy<T> retryPolicy = response -> false;
+
+ public Params() {}
/** Set the socket connect and read timeouts. */
- public Params setConnectionTimeout(Duration connectionTimeout) {
+ public Params<T> setConnectionTimeout(Duration connectionTimeout) {
this.connectionTimeout = Optional.of(connectionTimeout);
return this;
}
public Optional<Duration> getConnectionTimeout() { return connectionTimeout; }
+
+ /** Set the retry policy to use against the config servers. */
+ public Params<T> setRetryPolicy(RetryPolicy<T> retryPolicy) {
+ this.retryPolicy = retryPolicy;
+ return this;
+ }
+
+ public RetryPolicy<T> getRetryPolicy() { return retryPolicy; }
}
- <T> T get(String path, Class<T> wantedReturnType, Params params);
+ <T> T get(String path, Class<T> wantedReturnType, Params<T> params);
default <T> T get(String path, Class<T> wantedReturnType) {
- return get(path, wantedReturnType, null);
+ return get(path, wantedReturnType, new Params<>());
}
- <T> T post(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params params);
+ <T> T post(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params<T> params);
default <T> T post(String path, Object bodyJsonPojo, Class<T> wantedReturnType) {
- return post(path, bodyJsonPojo, wantedReturnType, null);
+ return post(path, bodyJsonPojo, wantedReturnType, new Params<>());
}
- <T> T put(String path, Optional<Object> bodyJsonPojo, Class<T> wantedReturnType, Params params);
+ <T> T put(String path, Optional<Object> bodyJsonPojo, Class<T> wantedReturnType, Params<T> params);
default <T> T put(String path, Optional<Object> bodyJsonPojo, Class<T> wantedReturnType) {
- return put(path, bodyJsonPojo, wantedReturnType, null);
+ return put(path, bodyJsonPojo, wantedReturnType, new Params<>());
}
- <T> T patch(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params params);
+ <T> T patch(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params<T> params);
default <T> T patch(String path, Object bodyJsonPojo, Class<T> wantedReturnType) {
- return patch(path, bodyJsonPojo, wantedReturnType, null);
+ return patch(path, bodyJsonPojo, wantedReturnType, new Params<>());
}
- <T> T delete(String path, Class<T> wantedReturnType, Params params);
+ <T> T delete(String path, Class<T> wantedReturnType, Params<T> params);
default <T> T delete(String path, Class<T> wantedReturnType) {
- return delete(path, wantedReturnType, null);
+ return delete(path, wantedReturnType, new Params<>());
}
/** Close the underlying HTTP client and any threads this class might have started. */
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java
index 67dcb6744ce..4a9c530d9c9 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java
@@ -106,8 +106,10 @@ public class ConfigServerApiImpl implements ConfigServerApi {
HttpUriRequest createRequest(URI configServerUri) throws JsonProcessingException, UnsupportedEncodingException;
}
- private <T> T tryAllConfigServers(CreateRequest requestFactory, Class<T> wantedReturnType) {
+ private <T> T tryAllConfigServers(CreateRequest requestFactory, Class<T> wantedReturnType, Params<T> params) {
+ T lastResult = null;
Exception lastException = null;
+
for (URI configServer : configServers) {
var request = Exceptions.uncheck(() -> requestFactory.createRequest(configServer));
try (CloseableHttpResponse response = client.execute(request)) {
@@ -115,15 +117,26 @@ public class ConfigServerApiImpl implements ConfigServerApi {
HttpException.handleStatusCode(response.getStatusLine().getStatusCode(),
request.getMethod() + " " + request.getURI() +
" failed with response '" + responseBody + "'");
+
+ T result;
try {
- return mapper.readValue(responseBody, wantedReturnType);
+ result = mapper.readValue(responseBody, wantedReturnType);
} catch (IOException e) {
throw new UncheckedIOException("Failed parse response from config server", e);
}
+
+ if (params.getRetryPolicy().tryNextConfigServer(result)) {
+ lastResult = result;
+ lastException = null;
+ } else {
+ return result;
+ }
} catch (HttpException e) {
if (!e.isRetryable()) throw e;
+ lastResult = null;
lastException = e;
} catch (Exception e) {
+ lastResult = null;
lastException = e;
if (configServers.size() == 1) break;
@@ -136,6 +149,11 @@ public class ConfigServerApiImpl implements ConfigServerApi {
}
}
+ if (lastResult != null) {
+ logger.warning("Giving up after trying all config servers: returning result: " + lastResult);
+ return lastResult;
+ }
+
String prefix = configServers.size() == 1 ?
"Request against " + configServers.get(0) + " failed: " :
"All requests against the config servers (" + configServers + ") failed, last as follows: ";
@@ -143,8 +161,8 @@ public class ConfigServerApiImpl implements ConfigServerApi {
}
@Override
- public <T> T put(String path, Optional<Object> bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull) {
- Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(paramsOrNull);
+ public <T> T put(String path, Optional<Object> bodyJsonPojo, Class<T> wantedReturnType, Params<T> params) {
+ Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(params);
return tryAllConfigServers(configServer -> {
HttpPut put = new HttpPut(configServer.resolve(path));
requestConfigOverride.ifPresent(put::setConfig);
@@ -153,51 +171,51 @@ public class ConfigServerApiImpl implements ConfigServerApi {
put.setEntity(new StringEntity(mapper.writeValueAsString(bodyJsonPojo.get())));
}
return put;
- }, wantedReturnType);
+ }, wantedReturnType, params);
}
@Override
- public <T> T patch(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull) {
- Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(paramsOrNull);
+ public <T> T patch(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params<T> params) {
+ Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(params);
return tryAllConfigServers(configServer -> {
HttpPatch patch = new HttpPatch(configServer.resolve(path));
requestConfigOverride.ifPresent(patch::setConfig);
setContentTypeToApplicationJson(patch);
patch.setEntity(new StringEntity(mapper.writeValueAsString(bodyJsonPojo)));
return patch;
- }, wantedReturnType);
+ }, wantedReturnType, params);
}
@Override
- public <T> T delete(String path, Class<T> wantedReturnType, Params paramsOrNull) {
- Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(paramsOrNull);
+ public <T> T delete(String path, Class<T> wantedReturnType, Params<T> params) {
+ Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(params);
return tryAllConfigServers(configServer -> {
HttpDelete delete = new HttpDelete(configServer.resolve(path));
requestConfigOverride.ifPresent(delete::setConfig);
return delete;
- }, wantedReturnType);
+ }, wantedReturnType, params);
}
@Override
- public <T> T get(String path, Class<T> wantedReturnType, Params paramsOrNull) {
- Optional<RequestConfig> requestConfig = getRequestConfigOverride(paramsOrNull);
+ public <T> T get(String path, Class<T> wantedReturnType, Params<T> params) {
+ Optional<RequestConfig> requestConfig = getRequestConfigOverride(params);
return tryAllConfigServers(configServer -> {
HttpGet get = new HttpGet(configServer.resolve(path));
requestConfig.ifPresent(get::setConfig);
return get;
- }, wantedReturnType);
+ }, wantedReturnType, params);
}
@Override
- public <T> T post(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull) {
- Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(paramsOrNull);
+ public <T> T post(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params<T> params) {
+ Optional<RequestConfig> requestConfigOverride = getRequestConfigOverride(params);
return tryAllConfigServers(configServer -> {
HttpPost post = new HttpPost(configServer.resolve(path));
requestConfigOverride.ifPresent(post::setConfig);
setContentTypeToApplicationJson(post);
post.setEntity(new StringEntity(mapper.writeValueAsString(bodyJsonPojo)));
return post;
- }, wantedReturnType);
+ }, wantedReturnType, params);
}
@Override
@@ -235,12 +253,12 @@ public class ConfigServerApiImpl implements ConfigServerApi {
.build();
}
- private static Optional<RequestConfig> getRequestConfigOverride(Params paramsOrNull) {
- if (paramsOrNull == null) return Optional.empty();
+ private static <T> Optional<RequestConfig> getRequestConfigOverride(Params<T> params) {
+ if (params.getConnectionTimeout().isEmpty()) return Optional.empty();
RequestConfig.Builder builder = RequestConfig.copy(DEFAULT_REQUEST_CONFIG);
- paramsOrNull.getConnectionTimeout().ifPresent(connectionTimeout -> {
+ params.getConnectionTimeout().ifPresent(connectionTimeout -> {
builder.setConnectTimeout((int) connectionTimeout.toMillis());
builder.setSocketTimeout((int) connectionTimeout.toMillis());
});
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java
index a3cc7042c47..b8ea119c0be 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java
@@ -6,6 +6,7 @@ import com.yahoo.vespa.hosted.node.admin.configserver.ConnectionException;
import com.yahoo.vespa.hosted.node.admin.configserver.HttpException;
import com.yahoo.vespa.hosted.node.admin.nodeadmin.ConvergenceException;
import com.yahoo.vespa.orchestrator.restapi.wire.BatchOperationResult;
+import com.yahoo.vespa.orchestrator.restapi.wire.HostStateChangeDenialReason;
import com.yahoo.vespa.orchestrator.restapi.wire.UpdateHostResponse;
import java.time.Duration;
@@ -44,7 +45,10 @@ public class OrchestratorImpl implements Orchestrator {
public void suspend(final String hostName) {
UpdateHostResponse response;
try {
- var params = new ConfigServerApi.Params().setConnectionTimeout(CONNECTION_TIMEOUT);
+ var params = new ConfigServerApi
+ .Params<UpdateHostResponse>()
+ .setConnectionTimeout(CONNECTION_TIMEOUT)
+ .setRetryPolicy(createRetryPolicyForSuspend());
response = configServerApi.put(getSuspendPath(hostName), Optional.empty(), UpdateHostResponse.class, params);
} catch (HttpException.NotFoundException n) {
throw new OrchestratorNotFoundException("Failed to suspend " + hostName + ", host not found");
@@ -61,11 +65,26 @@ public class OrchestratorImpl implements Orchestrator {
});
}
+ private static ConfigServerApi.RetryPolicy<UpdateHostResponse> createRetryPolicyForSuspend() {
+ return new ConfigServerApi.RetryPolicy<UpdateHostResponse>() {
+ @Override
+ public boolean tryNextConfigServer(UpdateHostResponse response) {
+ HostStateChangeDenialReason reason = response.reason();
+ if (reason == null) {
+ return false;
+ }
+
+ // The config server has likely just bootstrapped, so try the next.
+ return "unknown-service-status".equals(reason.constraintName());
+ }
+ };
+ }
+
@Override
public void suspend(String parentHostName, List<String> hostNames) {
final BatchOperationResult batchOperationResult;
try {
- var params = new ConfigServerApi.Params().setConnectionTimeout(CONNECTION_TIMEOUT);
+ var params = new ConfigServerApi.Params<BatchOperationResult>().setConnectionTimeout(CONNECTION_TIMEOUT);
String hostnames = String.join("&hostname=", hostNames);
String url = String.format("%s/%s?hostname=%s", ORCHESTRATOR_PATH_PREFIX_HOST_SUSPENSION_API,
parentHostName, hostnames);
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImplTest.java
index a11fdc903e7..bccf34e87ab 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImplTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImplTest.java
@@ -116,7 +116,7 @@ public class ConfigServerApiImplTest {
public void testBasicSuccessWithCustomTimeouts() {
mockReturnCode = TIMEOUT_RETURN_CODE;
- var params = new ConfigServerApi.Params();
+ var params = new ConfigServerApi.Params<TestPojo>();
params.setConnectionTimeout(Duration.ofSeconds(3));
try {
diff --git a/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp b/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
index 18b9962003c..b19c9163254 100644
--- a/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
@@ -12,6 +12,7 @@ LOG_SETUP("attribute_usage_filter_test");
using proton::AttributeUsageFilter;
using proton::AttributeUsageStats;
using proton::IAttributeUsageListener;
+using search::AddressSpaceComponents;
using search::AddressSpaceUsage;
using vespalib::AddressSpace;
@@ -27,17 +28,15 @@ class MyAttributeStats : public AttributeUsageStats
{
public:
void triggerEnumStoreLimit() {
- merge({ enumStoreOverLoad,
- search::AddressSpaceComponents::default_multi_value_usage() },
- "enumeratedName",
- "ready");
+ AddressSpaceUsage usage;
+ usage.set(AddressSpaceComponents::enum_store, enumStoreOverLoad);
+ merge(usage, "enumeratedName", "ready");
}
void triggerMultiValueLimit() {
- merge({ search::AddressSpaceComponents::default_enum_store_usage(),
- multiValueOverLoad },
- "multiValueName",
- "ready");
+ AddressSpaceUsage usage;
+ usage.set(AddressSpaceComponents::multi_value, multiValueOverLoad);
+ merge(usage, "multiValueName", "ready");
}
};
@@ -130,7 +129,8 @@ TEST_F("Check that multivalue limit can be reached", Fixture)
TEST_F("listener is updated when attribute stats change", Fixture)
{
AttributeUsageStats stats;
- AddressSpaceUsage usage(AddressSpace(12, 10, 15), AddressSpace(22, 20, 25));
+ AddressSpaceUsage usage;
+ usage.set("my_comp", AddressSpace(12, 10, 15));
stats.merge(usage, "my_attr", "my_subdb");
f.setAttributeStats(stats);
EXPECT_EQUAL(stats, f.listener->stats);
diff --git a/searchcore/src/vespa/searchcore/config/proton.def b/searchcore/src/vespa/searchcore/config/proton.def
index daaab2b823a..43743c23629 100644
--- a/searchcore/src/vespa/searchcore/config/proton.def
+++ b/searchcore/src/vespa/searchcore/config/proton.def
@@ -435,18 +435,6 @@ initialize.threads int default = 0
## before put and update operations in feed is blocked.
writefilter.attribute.address_space_limit double default = 0.9
-## Portion of enumstore address space that can be used before put and update
-## portion of feed is blocked.
-## Deprecated -> Use address_space_limit
-## TODO: remove this when enum store is removed from AttributeUsageStats
-writefilter.attribute.enumstorelimit double default = 0.9
-
-## Portion of attribute multivalue mapping address space that can be used
-## before put and update portion of feed is blocked.
-## Deprecated -> Use address_space_limit
-## TODO: remove this when multi value is removed from AttributeUsageStats
-writefilter.attribute.multivaluelimit double default = 0.9
-
## Portion of physical memory that can be resident memory in anonymous mapping
## by the proton process before put and update portion of feed is blocked.
writefilter.memorylimit double default = 0.8
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
index f0ab56562a6..d89e273df27 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
@@ -9,9 +9,7 @@ using search::AddressSpaceComponents;
namespace proton {
AttributeUsageStats::AttributeUsageStats()
- : _enumStoreUsage(AddressSpaceComponents::default_enum_store_usage()),
- _multiValueUsage(AddressSpaceComponents::default_multi_value_usage()),
- _max_usage(vespalib::AddressSpace())
+ : _max_usage(vespalib::AddressSpace())
{
}
@@ -22,8 +20,6 @@ AttributeUsageStats::merge(const search::AddressSpaceUsage &usage,
const vespalib::string &attributeName,
const vespalib::string &subDbName)
{
- _enumStoreUsage.merge(usage.enum_store_usage(), attributeName, AddressSpaceComponents::enum_store, subDbName);
- _multiValueUsage.merge(usage.multi_value_usage(), attributeName, AddressSpaceComponents::multi_value, subDbName);
for (const auto& entry : usage.get_all()) {
_max_usage.merge(entry.second, attributeName, entry.first, subDbName);
}
@@ -32,9 +28,7 @@ AttributeUsageStats::merge(const search::AddressSpaceUsage &usage,
std::ostream&
operator<<(std::ostream& out, const AttributeUsageStats& rhs)
{
- out << "{enum_store=" << rhs.enumStoreUsage() <<
- ", multi_value=" << rhs.multiValueUsage() <<
- ", max_address_space_usage=" << rhs.max_address_space_usage() << "}";
+ out << "{max_address_space_usage=" << rhs.max_address_space_usage() << "}";
return out;
}
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.h
index 762cc324f89..1411c626bfb 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.h
@@ -8,14 +8,11 @@
namespace proton {
/**
- * Class representing aggregated attribute usage, with info about
- * the most bloated attributes with regards to enum store and
- * multivalue mapping.
+ * Class representing aggregated max address space usage
+ * among components in attributes vectors in all sub databases.
*/
class AttributeUsageStats
{
- AddressSpaceUsageStats _enumStoreUsage;
- AddressSpaceUsageStats _multiValueUsage;
AddressSpaceUsageStats _max_usage;
public:
@@ -25,14 +22,10 @@ public:
const vespalib::string &attributeName,
const vespalib::string &subDbName);
- const AddressSpaceUsageStats& enumStoreUsage() const { return _enumStoreUsage; }
- const AddressSpaceUsageStats& multiValueUsage() const { return _multiValueUsage; }
const AddressSpaceUsageStats& max_address_space_usage() const { return _max_usage; }
bool operator==(const AttributeUsageStats& rhs) const {
- return (_enumStoreUsage == rhs._enumStoreUsage) &&
- (_multiValueUsage == rhs._multiValueUsage) &&
- (_max_usage == rhs._max_usage);
+ return (_max_usage == rhs._max_usage);
}
};
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp
index 7bd07dba505..d44f9ff6d2e 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp
+++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp
@@ -92,10 +92,6 @@ DocumentDBTaggedMetrics::AttributeMetrics::~AttributeMetrics() = default;
DocumentDBTaggedMetrics::AttributeMetrics::ResourceUsageMetrics::ResourceUsageMetrics(MetricSet *parent)
: MetricSet("resource_usage", {}, "Metrics for various attribute vector resources usage", parent),
- enumStore("enum_store", {}, "The highest relative amount of enum store address space used among "
- "all enumerated attribute vectors in this document db (value in the range [0, 1])", this),
- multiValue("multi_value", {}, "The highest relative amount of multi-value address space used among "
- "all multi-value attribute vectors in this document db (value in the range [0, 1])", this),
address_space("address_space", {}, "The max relative address space used among "
"components in all attribute vectors in this document db (value in the range [0, 1])", this),
feedingBlocked("feeding_blocked", {}, "Whether feeding is blocked due to attribute resource limits being reached (value is either 0 or 1)", this)
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h
index 8d225115c37..04e16cd5cb7 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h
+++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h
@@ -86,8 +86,6 @@ struct DocumentDBTaggedMetrics : metrics::MetricSet
{
struct ResourceUsageMetrics : metrics::MetricSet
{
- metrics::DoubleValueMetric enumStore;
- metrics::DoubleValueMetric multiValue;
metrics::DoubleValueMetric address_space;
metrics::LongValueMetric feedingBlocked;
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
index 956e9ea198e..753bd1cd148 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
@@ -304,11 +304,7 @@ DocumentDBMetricsUpdater::updateAttributeResourceUsageMetrics(DocumentDBTaggedMe
{
AttributeUsageStats stats = _writeFilter.getAttributeUsageStats();
bool feedBlocked = !_writeFilter.acceptWriteOperation();
- double enumStoreUsed = stats.enumStoreUsage().getUsage().usage();
- double multiValueUsed = stats.multiValueUsage().getUsage().usage();
double address_space_used = stats.max_address_space_usage().getUsage().usage();
- metrics.resourceUsage.enumStore.set(enumStoreUsed);
- metrics.resourceUsage.multiValue.set(multiValueUsed);
metrics.resourceUsage.address_space.set(address_space_used);
metrics.resourceUsage.feedingBlocked.set(feedBlocked ? 1 : 0);
}
diff --git a/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp b/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp
index da2e376719c..6783ea84354 100644
--- a/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/address_space_usage.cpp
@@ -12,15 +12,6 @@ AddressSpaceUsage::AddressSpaceUsage()
{
}
-AddressSpaceUsage::AddressSpaceUsage(const AddressSpace& enum_store_usage,
- const AddressSpace& multi_value_usage)
- : _map()
-{
- // TODO: Remove this constructor and instead add usage for each relevant component explicit.
- set(AddressSpaceComponents::enum_store, enum_store_usage);
- set(AddressSpaceComponents::multi_value, multi_value_usage);
-}
-
void
AddressSpaceUsage::set(const vespalib::string& component, const vespalib::AddressSpace& usage)
{
diff --git a/searchlib/src/vespa/searchlib/attribute/address_space_usage.h b/searchlib/src/vespa/searchlib/attribute/address_space_usage.h
index 9a92bb5d858..3fe24e39a14 100644
--- a/searchlib/src/vespa/searchlib/attribute/address_space_usage.h
+++ b/searchlib/src/vespa/searchlib/attribute/address_space_usage.h
@@ -20,8 +20,6 @@ private:
public:
AddressSpaceUsage();
- AddressSpaceUsage(const vespalib::AddressSpace& enum_store_usage,
- const vespalib::AddressSpace& multi_value_usage);
void set(const vespalib::string& component, const vespalib::AddressSpace& usage);
vespalib::AddressSpace get(const vespalib::string& component) const;
const AddressSpaceMap& get_all() const { return _map; }