Merge pull request #61361 from ClickHouse/small_improvement_for_replication_lib

Tiny improvement for replication.lib
This commit is contained in:
alesapin 2024-03-20 10:52:24 +01:00 committed by GitHub
commit cc732aa379
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,12 +26,15 @@ function try_sync_replicas()
done
done
i=0
for t in "${tables_arr[@]}"
do
# Do not start new merges (it can make SYNC a bit faster)
$CLICKHOUSE_CLIENT -q "ALTER TABLE $t MODIFY SETTING max_replicated_merges_in_queue=0"
done
i=0
for t in "${tables_arr[@]}"
do
$CLICKHOUSE_CLIENT --receive_timeout $time_left -q "SYSTEM SYNC REPLICA $t STRICT" || ($CLICKHOUSE_CLIENT -q \
"select 'sync failed, queue:', * from system.replication_queue where database=currentDatabase() and table='$t' order by database, table, node_name" && exit 1) &
pids[${i}]=$!