2021-09-12 12:35:27 +00:00
|
|
|
-- Tags: long, zookeeper
|
|
|
|
|
2019-12-16 15:51:15 +00:00
|
|
|
DROP TABLE IF EXISTS table_for_synchronous_mutations1;
|
|
|
|
DROP TABLE IF EXISTS table_for_synchronous_mutations2;
|
|
|
|
|
|
|
|
SELECT 'Replicated';
|
|
|
|
|
2021-08-05 06:55:07 +00:00
|
|
|
CREATE TABLE table_for_synchronous_mutations1(k UInt32, v1 UInt64) ENGINE ReplicatedMergeTree('/clickhouse/tables/{database}/test_01049/table_for_synchronous_mutations', '1') ORDER BY k;
|
2019-12-16 15:51:15 +00:00
|
|
|
|
2021-08-05 06:55:07 +00:00
|
|
|
CREATE TABLE table_for_synchronous_mutations2(k UInt32, v1 UInt64) ENGINE ReplicatedMergeTree('/clickhouse/tables/{database}/test_01049/table_for_synchronous_mutations', '2') ORDER BY k;
|
2019-12-16 15:51:15 +00:00
|
|
|
|
|
|
|
INSERT INTO table_for_synchronous_mutations1 select number, number from numbers(100000);
|
|
|
|
|
|
|
|
SYSTEM SYNC REPLICA table_for_synchronous_mutations2;
|
|
|
|
|
2019-12-19 15:27:56 +00:00
|
|
|
ALTER TABLE table_for_synchronous_mutations1 UPDATE v1 = v1 + 1 WHERE 1 SETTINGS mutations_sync = 2;
|
2019-12-16 15:51:15 +00:00
|
|
|
|
2021-08-07 10:02:30 +00:00
|
|
|
SELECT is_done FROM system.mutations where database = currentDatabase() and table = 'table_for_synchronous_mutations1';
|
2019-12-16 15:51:15 +00:00
|
|
|
|
|
|
|
-- Another mutation, just to be sure, that previous finished
|
2019-12-19 15:27:56 +00:00
|
|
|
ALTER TABLE table_for_synchronous_mutations1 UPDATE v1 = v1 + 1 WHERE 1 SETTINGS mutations_sync = 2;
|
2019-12-16 15:51:15 +00:00
|
|
|
|
2021-08-07 10:02:30 +00:00
|
|
|
SELECT is_done FROM system.mutations where database = currentDatabase() and table = 'table_for_synchronous_mutations1';
|
2019-12-16 15:51:15 +00:00
|
|
|
|
|
|
|
DROP TABLE IF EXISTS table_for_synchronous_mutations1;
|
|
|
|
DROP TABLE IF EXISTS table_for_synchronous_mutations2;
|
|
|
|
|
|
|
|
SELECT 'Normal';
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS table_for_synchronous_mutations_no_replication;
|
|
|
|
|
2019-12-16 19:56:17 +00:00
|
|
|
CREATE TABLE table_for_synchronous_mutations_no_replication(k UInt32, v1 UInt64) ENGINE MergeTree ORDER BY k;
|
2019-12-16 15:51:15 +00:00
|
|
|
|
|
|
|
INSERT INTO table_for_synchronous_mutations_no_replication select number, number from numbers(100000);
|
|
|
|
|
2019-12-19 15:27:56 +00:00
|
|
|
ALTER TABLE table_for_synchronous_mutations_no_replication UPDATE v1 = v1 + 1 WHERE 1 SETTINGS mutations_sync = 2;
|
2019-12-16 15:51:15 +00:00
|
|
|
|
2021-08-07 10:02:30 +00:00
|
|
|
SELECT is_done FROM system.mutations where database = currentDatabase() and table = 'table_for_synchronous_mutations_no_replication';
|
2019-12-16 15:51:15 +00:00
|
|
|
|
|
|
|
-- Another mutation, just to be sure, that previous finished
|
2019-12-19 15:27:56 +00:00
|
|
|
ALTER TABLE table_for_synchronous_mutations_no_replication UPDATE v1 = v1 + 1 WHERE 1 SETTINGS mutations_sync = 2;
|
2019-12-16 15:51:15 +00:00
|
|
|
|
2021-08-07 10:02:30 +00:00
|
|
|
SELECT is_done FROM system.mutations where database = currentDatabase() and table = 'table_for_synchronous_mutations_no_replication';
|
2019-12-16 15:51:15 +00:00
|
|
|
|
|
|
|
DROP TABLE IF EXISTS table_for_synchronous_mutations_no_replication;
|