mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Fix forget_partition
test (#61237)
This commit is contained in:
parent
7a5ac383e5
commit
cb28c84a93
15
tests/queries/0_stateless/02995_forget_partition.sql → tests/queries/0_stateless/02995_forget_partition.sh
Normal file → Executable file
15
tests/queries/0_stateless/02995_forget_partition.sql → tests/queries/0_stateless/02995_forget_partition.sh
Normal file → Executable file
@ -1,5 +1,12 @@
|
||||
-- Tags: zookeeper, no-replicated-database
|
||||
#!/usr/bin/env bash
|
||||
# Tags: zookeeper, no-replicated-database
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
|
||||
${CLICKHOUSE_CLIENT} --multiline --multiquery -q """
|
||||
drop table if exists forget_partition;
|
||||
|
||||
create table forget_partition
|
||||
@ -16,7 +23,12 @@ insert into forget_partition select number, '2024-01-01' + interval number day,
|
||||
|
||||
alter table forget_partition drop partition '20240101';
|
||||
alter table forget_partition drop partition '20240102';
|
||||
"""
|
||||
|
||||
# DROP PARTITION do not wait for a part to be removed from memory due to possible concurrent SELECTs, so we have to do wait manually here
|
||||
while [[ $(${CLICKHOUSE_CLIENT} -q "select count() from system.parts where database=currentDatabase() and table='forget_partition' and partition='20240101'") != 0 ]]; do sleep 0.1; done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --multiline --multiquery -q """
|
||||
set allow_unrestricted_reads_from_keeper=1;
|
||||
|
||||
select '---before---';
|
||||
@ -31,3 +43,4 @@ select '---after---';
|
||||
select name from system.zookeeper where path = '/test/02995/' || currentDatabase() || '/rmt/block_numbers' order by name;
|
||||
|
||||
drop table forget_partition;
|
||||
"""
|
Loading…
Reference in New Issue
Block a user