ClickHouse/tests/queries/0_stateless/02994_merge_tree_mutations_cleanup.sql.j2
Azat Khuzhin 3c08e198ad tests: wait for mutations in 02994_merge_tree_mutations_cleanup.sql.j2
Otherwise it fails in private fork CI

Co-authored-by: János Benjamin Antal <antaljanosbenjamin@users.noreply.github.com>
2024-03-12 10:39:41 +01:00

15 lines
995 B
Django/Jinja

drop table if exists data_rmt;
drop table if exists data_mt;
create table data_rmt (key Int) engine=ReplicatedMergeTree('/tables/{database}/data', '{table}') order by tuple() settings finished_mutations_to_keep=0, merge_tree_clear_old_parts_interval_seconds=1;
create table data_mt (key Int) engine=MergeTree() order by tuple() settings finished_mutations_to_keep=0, merge_tree_clear_old_parts_interval_seconds=1;
{% for table in ['data_rmt', 'data_mt'] %}
alter table {{table}} delete where 1 settings mutations_sync = 1;
select 'mutations after ALTER for {{table}}', count() from system.mutations where database = currentDatabase() and table = '{{table}}';
-- merge_tree_clear_old_parts_interval_seconds=1, but wait few seconds more
select sleep(5) settings function_sleep_max_microseconds_per_block=10e6 format Null;
select 'mutations after cleanup for {{table}}', count() from system.mutations where database = currentDatabase() and table = '{{table}}';
drop table {{table}};
{% endfor %}