From bd790f399fab0a63c74b85130f780cb1e0c1efc9 Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Fri, 2 Oct 2020 22:34:37 +0300 Subject: [PATCH] simplify test --- ...on_stuck_after_replace_partition.reference | 35 ++++++------------- ...mutation_stuck_after_replace_partition.sql | 31 ++++++---------- 2 files changed, 20 insertions(+), 46 deletions(-) diff --git a/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.reference b/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.reference index a0bbc35566d..edf8a7e391c 100644 --- a/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.reference +++ b/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.reference @@ -1,29 +1,14 @@ -1 -2 -44 -33 -3 -4 -default mt 0 0_1_1_0 2 -default mt 3 3_2_2_0 1 -default mt 4 4_3_3_0 1 -default rmt 0 0_0_0_0 2 -3 -4 -default mt 0 0_1_1_0 2 -default mt 3 3_2_2_0 1 -default mt 4 4_3_3_0 1 -default rmt 0 0_2_2_0 2 -3 -4 1 1 2 2 -3 -4 -default mt 0 0_1_1_0 2 -default mt 3 3_2_2_0 1 -default mt 4 4_3_3_0 1 -default rmt 0 0_6_6_0 2 -default rmt 0000000000 DROP COLUMN s 2020-10-02 17:46:31 ['0'] [3] ['0_0_5_4294967295'] 1 1 1970-01-01 03:00:00 +3 3 +4 4 +mt 0 0_1_1_0 2 +rmt 0 0_0_0_0 2 +1 1 +2 2 +mt 0 0_1_1_0 2 +rmt 0 0_3_3_0 2 +0000000000 UPDATE s = concat(\'s\', toString(n)) WHERE 1 [] 0 1 +0000000001 DROP COLUMN s [] 0 1 3 4 diff --git a/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.sql b/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.sql index 6cb5953e8f4..c9b355b1e4e 100644 --- a/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.sql +++ b/tests/queries/0_stateless/01149_zookeeper_mutation_stuck_after_replace_partition.sql @@ -1,39 +1,28 @@ drop table if exists mt; drop table if exists rmt; +create table mt (n UInt64, s String) engine = MergeTree partition by intDiv(n, 10) order by n; +insert into mt values (3, '3'), (4, '4'); -create table mt (`n` UInt64) engine = MergeTree partition by intDiv(n, 10) order by n; +create table rmt (n UInt64, s String) engine = ReplicatedMergeTree('/clickhouse/test_01149/rmt', 'r1') partition by intDiv(n, 10) order by n; +insert into rmt values (1,'1'), (2, '2'); -insert into mt values (3), (4), (33), (44); - -create table rmt (`n` UInt64) engine = ReplicatedMergeTree('/clickhouse/test_01149/rmt1', 'r1') partition by intDiv(n, 10) order by n; - -insert into rmt values (1), (2); select * from rmt; select * from mt; +select table, partition_id, name, rows from system.parts where database=currentDatabase() and table in ('mt', 'rmt') order by table, name; -select database, table, partition_id, name, rows from system.parts where database=currentDatabase() and table in ('mt', 'rmt') order by table, name; - -alter table rmt replace partition '0' from mt; -select * from rmt; -select database, table, partition_id, name, rows from system.parts where database=currentDatabase() and table in ('mt', 'rmt') order by table, name; - -alter table rmt add column s String; -alter table rmt drop column s; -select * from rmt; -alter table rmt add column s String; -insert into rmt values (1, '1'), (2, '2'); -alter table mt add column s String; +alter table rmt update s = 's'||toString(n) where 1; -- increment mutation version select * from rmt; alter table rmt replace partition '0' from mt; -- (probably) removes parts incorrectly -select database, table, partition_id, name, rows from system.parts where database=currentDatabase() and table in ('mt', 'rmt') order by table, name; +--system restart replica rmt; -- workaround + +select table, partition_id, name, rows from system.parts where database=currentDatabase() and table in ('mt', 'rmt') order by table, name; alter table rmt drop column s; -- hangs waiting for mutation of removed parts -- see parts_to_do -select * from system.mutations where database=currentDatabase() and table='rmt'; - +select mutation_id, command, parts_to_do_names, parts_to_do, is_done from system.mutations where database=currentDatabase() and table='rmt'; select * from rmt; drop table mt;