diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-01-12 14:10:53 +0100 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-01-12 14:11:16 +0100 |
commit | 5e425b8215b05e573ee9321f1cae509bb259d370 (patch) | |
tree | a8d32cbf44c2b137d3217bce1ad921849179269b /config-model/src/test/java | |
parent | 3ba7c920fe516ede58001a0f8cbb5a9a6c9c2706 (diff) |
Add feature flag for controlling throttling of async persistence operations
Currently defaults to `UNLIMITED` throttling policy, i.e. legacy behavior.
Diffstat (limited to 'config-model/src/test/java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java index 739f8b7fff2..740193feeff 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java @@ -306,6 +306,25 @@ public class StorageClusterTest { } @Test + public void persistence_async_throttle_config_defaults_to_unlimited() { + var config = filestorConfigFromProducer(simpleCluster(new TestProperties())); + assertEquals(StorFilestorConfig.Async_operation_throttler_type.UNLIMITED, config.async_operation_throttler_type()); + } + + @Test + public void persistence_async_throttle_config_is_derived_from_flag() { + var config = filestorConfigFromProducer(simpleCluster(new TestProperties().setPersistenceAsyncThrottling("UNLIMITED"))); + assertEquals(StorFilestorConfig.Async_operation_throttler_type.UNLIMITED, config.async_operation_throttler_type()); + + config = filestorConfigFromProducer(simpleCluster(new TestProperties().setPersistenceAsyncThrottling("DYNAMIC"))); + assertEquals(StorFilestorConfig.Async_operation_throttler_type.DYNAMIC, config.async_operation_throttler_type()); + + // Invalid enum values fall back to the default + config = filestorConfigFromProducer(simpleCluster(new TestProperties().setPersistenceAsyncThrottling("BANANAS"))); + assertEquals(StorFilestorConfig.Async_operation_throttler_type.UNLIMITED, config.async_operation_throttler_type()); + } + + @Test public void integrity_checker_explicitly_disabled_when_not_running_with_vds_provider() { StorIntegritycheckerConfig.Builder builder = new StorIntegritycheckerConfig.Builder(); parse(cluster("bees", "")).getConfig(builder); |