This commit is contained in:
Alexander Gololobov 2024-11-23 18:03:06 +01:00 committed by GitHub
commit eecbb16b1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

View File

@ -47,6 +47,8 @@ KeeperContext::KeeperContext(bool standalone_keeper_, CoordinationSettingsPtr co
/// enable by default some feature flags /// enable by default some feature flags
feature_flags.enableFeatureFlag(KeeperFeatureFlag::FILTERED_LIST); feature_flags.enableFeatureFlag(KeeperFeatureFlag::FILTERED_LIST);
feature_flags.enableFeatureFlag(KeeperFeatureFlag::MULTI_READ); feature_flags.enableFeatureFlag(KeeperFeatureFlag::MULTI_READ);
feature_flags.enableFeatureFlag(KeeperFeatureFlag::CHECK_NOT_EXISTS);
feature_flags.enableFeatureFlag(KeeperFeatureFlag::CREATE_IF_NOT_EXISTS);
system_nodes_with_data[keeper_api_feature_flags_path] = feature_flags.getFeatureFlags(); system_nodes_with_data[keeper_api_feature_flags_path] = feature_flags.getFeatureFlags();
/// for older clients, the default is equivalent to WITH_MULTI_READ version /// for older clients, the default is equivalent to WITH_MULTI_READ version

View File

@ -3194,8 +3194,6 @@ TYPED_TEST(CoordinationTest, TestFeatureFlags)
feature_flags.setFeatureFlags(get_response.data); feature_flags.setFeatureFlags(get_response.data);
ASSERT_TRUE(feature_flags.isEnabled(KeeperFeatureFlag::FILTERED_LIST)); ASSERT_TRUE(feature_flags.isEnabled(KeeperFeatureFlag::FILTERED_LIST));
ASSERT_TRUE(feature_flags.isEnabled(KeeperFeatureFlag::MULTI_READ)); ASSERT_TRUE(feature_flags.isEnabled(KeeperFeatureFlag::MULTI_READ));
ASSERT_FALSE(feature_flags.isEnabled(KeeperFeatureFlag::CHECK_NOT_EXISTS));
ASSERT_FALSE(feature_flags.isEnabled(KeeperFeatureFlag::CREATE_IF_NOT_EXISTS));
ASSERT_FALSE(feature_flags.isEnabled(KeeperFeatureFlag::REMOVE_RECURSIVE)); ASSERT_FALSE(feature_flags.isEnabled(KeeperFeatureFlag::REMOVE_RECURSIVE));
} }

View File

@ -83,7 +83,12 @@ def test_keeper_feature_flags(started_cluster):
assert f"{feature}\t{1 if is_enabled else 0}" in res assert f"{feature}\t{1 if is_enabled else 0}" in res
assert_feature_flags( assert_feature_flags(
[("filtered_list", 1), ("multi_read", 1), ("check_not_exists", 0)] [
("filtered_list", 1),
("multi_read", 1),
("check_not_exists", 1),
("create_if_not_exists", 1),
]
) )
feature_flags = [ feature_flags = [