mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #52144 from ClickHouse/fix-kill-mutation
Fix the "kill_mutation" test
This commit is contained in:
commit
c68de09e0a
@ -2,7 +2,7 @@
|
||||
1
|
||||
waiting default kill_mutation mutation_3.txt DELETE WHERE toUInt32(s) = 1
|
||||
*** Create and kill invalid mutation that blocks another mutation ***
|
||||
happened during execution of mutations 'mutation_4.txt, mutation_5.txt'
|
||||
happened during execution of mutation
|
||||
1
|
||||
waiting default kill_mutation mutation_4.txt DELETE WHERE toUInt32(s) = 1
|
||||
2001-01-01 2 b
|
||||
|
@ -27,8 +27,22 @@ ${CLICKHOUSE_CLIENT} --query="SELECT mutation_id FROM system.mutations WHERE dat
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT '*** Create and kill invalid mutation that blocks another mutation ***'"
|
||||
|
||||
# Note: there is a benign race condition.
|
||||
# The mutation can fail with the message
|
||||
# "Cannot parse string 'a' as UInt32"
|
||||
# or
|
||||
# "Cannot parse string 'b' as UInt32"
|
||||
# depending on which parts are processed first.
|
||||
# The mutations are also coalesced together, and the subsequent mutation inherits the failure status of the original mutation.
|
||||
# When we are waiting for mutations, we are listing all the mutations with identical error messages.
|
||||
# But due to a race condition and to repeated runs, the original and subsequent mutations can have different error messages,
|
||||
# therefore the original mutation will not be included in the list.
|
||||
|
||||
# Originally, there was grep "happened during execution of mutations 'mutation_4.txt, mutation_5.txt'",
|
||||
# but due to this race condition, I've replaced it to grep "happened during execution of mutation"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="ALTER TABLE kill_mutation DELETE WHERE toUInt32(s) = 1"
|
||||
${CLICKHOUSE_CLIENT} --query="ALTER TABLE kill_mutation DELETE WHERE x = 1 SETTINGS mutations_sync = 1" 2>&1 | grep -o "happened during execution of mutations 'mutation_4.txt, mutation_5.txt'" | head -n 1
|
||||
${CLICKHOUSE_CLIENT} --query="ALTER TABLE kill_mutation DELETE WHERE x = 1 SETTINGS mutations_sync = 1" 2>&1 | grep -o "happened during execution of mutation" | head -n 1
|
||||
|
||||
# but exception doesn't stop mutations, and we will still see them in system.mutations
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT count() FROM system.mutations WHERE database = '$CLICKHOUSE_DATABASE' AND table = 'kill_mutation' AND mutation_id = 'mutation_4.txt'" # 1
|
||||
|
Loading…
Reference in New Issue
Block a user