diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-24 09:07:00 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-24 09:07:00 +0000 |
commit | 7aef2017e0af21f9b0f1290f2299bcb39319a384 (patch) | |
tree | 763b597f3ad7b4e435f837e6e54ff4b3f9308dcd /searchcore/src/tests/proton/proton_config_fetcher | |
parent | f3c40af9152d7c6eb9616073626551cef258a52d (diff) |
- Introduce the concept of minimal capacity for rcu vectors.
- This is to prevent shrinking down past what has been configured in proton.documentdb[].allocation.initialnumdocs
- shrinking down past the configured value is not supported as that would counter the preallocation done to prevent resizing.
Diffstat (limited to 'searchcore/src/tests/proton/proton_config_fetcher')
-rw-r--r-- | searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp index 4022bd68c92..f6c1518ba90 100644 --- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp +++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp @@ -404,6 +404,10 @@ TEST_FF("require that docstore config computes cachesize automatically if unset" EXPECT_EQUAL(500000ul, config->getStoreConfig().getMaxCacheBytes()); } +GrowStrategy +growStrategy(uint32_t initial) { + return GrowStrategy(initial, 0.1, 1, initial, 0.15); +} TEST_FF("require that allocation config is propagated", ConfigTestFixture("test"), DocumentDBConfigManager(f1.configId + "/test", "test")) @@ -424,9 +428,9 @@ TEST_FF("require that allocation config is propagated", auto config = getDocumentDBConfig(f1, f2); { auto& alloc_config = config->get_alloc_config(); - EXPECT_EQUAL(AllocStrategy(GrowStrategy(20000000, 0.1, 1, 0.15), CompactionStrategy(0.25, 0.3), 10000), alloc_config.make_alloc_strategy(SubDbType::READY)); - EXPECT_EQUAL(AllocStrategy(GrowStrategy(100000, 0.1, 1, 0.15), CompactionStrategy(0.25, 0.3), 10000), alloc_config.make_alloc_strategy(SubDbType::REMOVED)); - EXPECT_EQUAL(AllocStrategy(GrowStrategy(30000000, 0.1, 1, 0.15), CompactionStrategy(0.25, 0.3), 10000), alloc_config.make_alloc_strategy(SubDbType::NOTREADY)); + EXPECT_EQUAL(AllocStrategy(growStrategy(20000000), CompactionStrategy(0.25, 0.3), 10000), alloc_config.make_alloc_strategy(SubDbType::READY)); + EXPECT_EQUAL(AllocStrategy(growStrategy(100000), CompactionStrategy(0.25, 0.3), 10000), alloc_config.make_alloc_strategy(SubDbType::REMOVED)); + EXPECT_EQUAL(AllocStrategy(growStrategy(30000000), CompactionStrategy(0.25, 0.3), 10000), alloc_config.make_alloc_strategy(SubDbType::NOTREADY)); } } |