mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
01006_simpod_empty_part_single_column_write: Use sync mutation instead of waiting
This commit is contained in:
parent
be126cbbc5
commit
1f3c8387a3
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user