summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/attribute
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2021-08-18 15:00:49 +0000
committerGeir Storli <geirst@verizonmedia.com>2021-08-20 11:03:58 +0000
commiteadf49cb8c1feff72098a5f2b6a44bfe82702812 (patch)
treec1e6575814cd9a3a87cae988f6c8453eea45a977 /searchcore/src/tests/proton/attribute
parent30e1e7d2cf1c6af481aee791c32580c6cf662aa0 (diff)
Use max address space used in attribute vector components to determine whether to block put and update operations in proton.
Diffstat (limited to 'searchcore/src/tests/proton/attribute')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp49
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_usage_stats/attribute_usage_stats_test.cpp2
2 files changed, 11 insertions, 40 deletions
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 a1c7b0a152d..18b9962003c 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
@@ -95,65 +95,36 @@ TEST_F("Check that default filter allows write", Fixture)
TEST_F("Check that enum store limit can be reached", Fixture)
{
- f.filter.setConfig(Fixture::Config(0.8, 1.0));
+ f.filter.setConfig(Fixture::Config(0.8));
MyAttributeStats stats;
stats.triggerEnumStoreLimit();
f.setAttributeStats(stats);
- f.testWrite("enumStoreLimitReached: { "
+ f.testWrite("addressSpaceLimitReached: { "
"action: \""
"add more content nodes"
"\", "
"reason: \""
- "enum store address space used (0.9375) > limit (0.8)"
+ "max address space in attribute vector components used (0.9375) > limit (0.8)"
"\", "
- "enumStore: { used: 32212254720, dead: 0, limit: 34359738368}, "
- "attributeName: \"enumeratedName\", subdb: \"ready\"}");
+ "addressSpace: { used: 32212254720, dead: 0, limit: 34359738368}, "
+ "attributeName: \"enumeratedName\", componentName: \"enum-store\", subdb: \"ready\"}");
}
TEST_F("Check that multivalue limit can be reached", Fixture)
{
- f.filter.setConfig(Fixture::Config(1.0, 0.8));
+ f.filter.setConfig(Fixture::Config(0.8));
MyAttributeStats stats;
stats.triggerMultiValueLimit();
f.setAttributeStats(stats);
- f.testWrite("multiValueLimitReached: { "
+ f.testWrite("addressSpaceLimitReached: { "
"action: \""
"add more content nodes"
"\", "
"reason: \""
- "multiValue address space used (0.992188) > limit (0.8)"
+ "max address space in attribute vector components used (0.992188) > limit (0.8)"
"\", "
- "multiValue: { used: 133169152, dead: 0, limit: 134217728}, "
- "attributeName: \"multiValueName\", subdb: \"ready\"}");
-}
-
-TEST_F("Check that both enumstore limit and multivalue limit can be reached",
- Fixture)
-{
- f.filter.setConfig(Fixture::Config(0.8, 0.8));
- MyAttributeStats stats;
- stats.triggerEnumStoreLimit();
- stats.triggerMultiValueLimit();
- f.setAttributeStats(stats);
- f.testWrite("enumStoreLimitReached: { "
- "action: \""
- "add more content nodes"
- "\", "
- "reason: \""
- "enum store address space used (0.9375) > limit (0.8)"
- "\", "
- "enumStore: { used: 32212254720, dead: 0, limit: 34359738368}, "
- "attributeName: \"enumeratedName\", subdb: \"ready\"}"
- ", "
- "multiValueLimitReached: { "
- "action: \""
- "add more content nodes"
- "\", "
- "reason: \""
- "multiValue address space used (0.992188) > limit (0.8)"
- "\", "
- "multiValue: { used: 133169152, dead: 0, limit: 134217728}, "
- "attributeName: \"multiValueName\", subdb: \"ready\"}");
+ "addressSpace: { used: 133169152, dead: 0, limit: 134217728}, "
+ "attributeName: \"multiValueName\", componentName: \"multi-value\", subdb: \"ready\"}");
}
TEST_F("listener is updated when attribute stats change", Fixture)
diff --git a/searchcore/src/tests/proton/attribute/attribute_usage_stats/attribute_usage_stats_test.cpp b/searchcore/src/tests/proton/attribute/attribute_usage_stats/attribute_usage_stats_test.cpp
index 025ae859993..b85d3b43f5b 100644
--- a/searchcore/src/tests/proton/attribute/attribute_usage_stats/attribute_usage_stats_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_usage_stats/attribute_usage_stats_test.cpp
@@ -12,7 +12,7 @@ expect_max_usage(size_t used, const vespalib::string& attr_name,
const vespalib::string& comp_name, const vespalib::string& sub_name,
const AttributeUsageStats& stats)
{
- const auto& max = stats.max_usage();
+ const auto& max = stats.max_address_space_usage();
EXPECT_EQ(used, max.getUsage().used());
EXPECT_EQ(attr_name, max.getAttributeName());
EXPECT_EQ(comp_name, max.get_component_name());