01006_simpod_empty_part_single_column_write: Use sync mutation instead of waiting

This commit is contained in:
Raúl Marín 2021-07-30 15:53:33 +02:00
parent be126cbbc5
commit 1f3c8387a3
2 changed files with 2 additions and 8 deletions

View File

@ -26,13 +26,7 @@ ${CLICKHOUSE_CLIENT} --query="INSERT INTO table_with_empty_part VALUES (1, 1)"
${CLICKHOUSE_CLIENT} --query="INSERT INTO table_with_empty_part VALUES (2, 2)"
${CLICKHOUSE_CLIENT} --query="ALTER TABLE table_with_empty_part DELETE WHERE id % 2 == 0"
sleep 0.5
mutation_id=$(${CLICKHOUSE_CLIENT} --query="SELECT max(mutation_id) FROM system.mutations WHERE table='table_with_empty_part'")
wait_for_mutation "table_with_empty_part" "$mutation_id"
${CLICKHOUSE_CLIENT} --mutations_sync=2 --query="ALTER TABLE table_with_empty_part DELETE WHERE id % 2 == 0"
${CLICKHOUSE_CLIENT} --query="SELECT COUNT(DISTINCT value) FROM table_with_empty_part"

View File

@ -10,7 +10,7 @@ function wait_for_mutation()
for i in {1..100}
do
sleep 0.1
if [[ $(${CLICKHOUSE_CLIENT} --query="SELECT min(is_done) + (count() == 0) FROM system.mutations WHERE database='$database' AND table='$table' AND mutation_id='$mutation_id'") -eq 1 ]]; then
if [[ $(${CLICKHOUSE_CLIENT} --query="SELECT min(is_done) FROM system.mutations WHERE database='$database' AND table='$table' AND mutation_id='$mutation_id'") -eq 1 ]]; then
break
fi