Randomize settings

This commit is contained in:
Antonio Andelic 2023-09-18 11:13:32 +00:00
parent 69333912d5
commit 7ffe998f1d
2 changed files with 16 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<tcp_port>9181</tcp_port>
<server_id>1</server_id>
<create_snapshot_on_exit>true</create_snapshot_on_exit>
<create_snapshot_on_exit>1</create_snapshot_on_exit>
<coordination_settings>
<operation_timeout_ms>10000</operation_timeout_ms>
@ -32,7 +32,10 @@
</raft_configuration>
<feature_flags>
<filtered_list>1</filtered_list>
<multi_read>1</multi_read>
<check_not_exists>1</check_not_exists>
<create_if_not_exists>1</create_if_not_exists>
</feature_flags>
</keeper_server>
</clickhouse>

View File

@ -123,9 +123,19 @@ else
ln -sf $SRC_PATH/config.d/zookeeper.xml $DEST_SERVER_PATH/config.d/
fi
function randomize_config_boolean_value {
value=$(($RANDOM % 2))
sed --follow-symlinks -i "s|<$1>[01]</$1>|<$1>$value</$1>|" $DEST_SERVER_PATH/config.d/keeper_port.xml
}
# We randomize creating the snapshot on exit for Keeper to test out using older snapshots
create_snapshot_on_exit=$(($RANDOM % 2))
sed --follow-symlinks -i "s|<create_snapshot_on_exit>true</create_snapshot_on_exit>|<create_snapshot_on_exit>$create_snapshot_on_exit</create_snapshot_on_exit>|" $DEST_SERVER_PATH/config.d/keeper_port.xml
randomize_config_boolean_value create_snapshot_on_exit
# Randomize all Keeper feature flags
randomize_config_boolean_value filtered_list
randomize_config_boolean_value multi_read
randomize_config_boolean_value check_not_exists
randomize_config_boolean_value create_if_not_exists
if [[ -n "$USE_POLYMORPHIC_PARTS" ]] && [[ "$USE_POLYMORPHIC_PARTS" -eq 1 ]]; then
ln -sf $SRC_PATH/config.d/polymorphic_parts.xml $DEST_SERVER_PATH/config.d/