tests: 02340_parts_refcnt_mergetree cleanup

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2024-05-16 14:30:25 +02:00
parent 85998672f0
commit 0832f96107

View File

@ -19,13 +19,19 @@ function check_refcnt_for_table()
local query_id
query_id="$table-$(random_str 10)"
SETTINGS="--format Null --max_threads 1 --max_block_size 1 --merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability 0.0"
local args=(
--format Null
--max_threads 1
--max_block_size 1
--merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability 0.0
--query_id "$query_id"
)
# Notes:
# - query may sleep 1*(200/4)=50 seconds maximum, it is enough to check system.parts
# - "part = 1" condition should prune all parts except first
# - max_block_size=1 with index_granularity=1 will allow to cancel the query earlier
$CLICKHOUSE_CLIENT $SETTINGS --query_id "$query_id" -q "select sleepEachRow(1) from $table where part = 1" &
$CLICKHOUSE_CLIENT "${args[@]}" -q "select sleepEachRow(1) from $table where part = 1" &
PID=$!
# wait for query to be started