summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-02-14 15:55:16 +0100
committerGitHub <noreply@github.com>2022-02-14 15:55:16 +0100
commitadfb8ded72e194875ed9347569b169132e8b725e (patch)
treedfc3ef73fa5c787f7eb671d1f41ecdf1ed1afd89
parent952f3d26e9586fd22f80e7c9d43901c60ed4f86e (diff)
parent2c267b3cbad261cff1ff1383d7ddd90435a98820 (diff)
Merge pull request #21176 from vespa-engine/toregge/handle-64k-page-size
Handle 64K page size when testing paged attributes.
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp
index 0ae495035f0..d7d0bfd4012 100644
--- a/searchlib/src/tests/attribute/attribute_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_test.cpp
@@ -23,6 +23,8 @@
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/mmap_file_allocator_factory.h>
+#include <vespa/vespalib/util/round_up_to_page_size.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/fastos/file.h>
#include <cmath>
#include <iostream>
@@ -2283,13 +2285,20 @@ int
AttributeTest::test_paged_attribute(const vespalib::string& name, const vespalib::string& swapfile, const search::attribute::Config& cfg)
{
int result = 1;
+ size_t rounded_size = vespalib::round_up_to_page_size(1);
+ size_t lid_mapping_size = 1200;
+ size_t sv_maxlid = 1200;
+ if (rounded_size == 64_Ki) {
+ lid_mapping_size = 17000;
+ sv_maxlid = 1500;
+ }
LOG(info, "test_paged_attribute '%s'", name.c_str());
auto av = createAttribute(name, cfg);
auto v = std::dynamic_pointer_cast<IntegerAttribute>(av);
ASSERT_TRUE(v);
auto size1 = stat_size(swapfile);
// Grow mapping from lid to value or multivalue index
- addClearedDocs(av, 1200);
+ addClearedDocs(av, lid_mapping_size);
auto size2 = stat_size(swapfile);
auto size3 = size2;
EXPECT_LESS(size1, size2);
@@ -2308,7 +2317,7 @@ AttributeTest::test_paged_attribute(const vespalib::string& name, const vespalib
}
if (cfg.fastSearch()) {
// Grow enum store
- uint32_t maxlid = cfg.collectionType().isMultiValue() ? 100 : 1200;
+ uint32_t maxlid = cfg.collectionType().isMultiValue() ? 100 : sv_maxlid;
for (uint32_t lid = 1; lid < maxlid; ++lid) {
av->clearDoc(lid);
if (cfg.collectionType().isMultiValue()) {