ClickHouse/tests/queries/0_stateless/00732_quorum_insert_have_data_before_quorum_zookeeper.sql

32 lines
950 B
MySQL
Raw Normal View History

2018-10-16 10:52:15 +00:00
SET send_logs_level = 'none';
DROP TABLE IF EXISTS quorum1;
DROP TABLE IF EXISTS quorum2;
2018-10-16 10:52:15 +00:00
CREATE TABLE quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '1') ORDER BY x PARTITION BY y;
CREATE TABLE quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '2') ORDER BY x PARTITION BY y;
2018-10-16 10:52:15 +00:00
INSERT INTO quorum1 VALUES (1, '1990-11-15');
INSERT INTO quorum1 VALUES (2, '1990-11-15');
INSERT INTO quorum1 VALUES (3, '2020-12-16');
2018-10-16 10:52:15 +00:00
SYSTEM SYNC REPLICA quorum2;
2018-10-16 10:52:15 +00:00
SET select_sequential_consistency=1;
SELECT x FROM quorum1 ORDER BY x;
SELECT x FROM quorum2 ORDER BY x;
2018-10-16 10:52:15 +00:00
SET insert_quorum=2;
INSERT INTO quorum1 VALUES (4, '1990-11-15');
INSERT INTO quorum1 VALUES (5, '1990-11-15');
INSERT INTO quorum1 VALUES (6, '2020-12-16');
2018-10-16 10:52:15 +00:00
SELECT x FROM quorum1 ORDER BY x;
SELECT x FROM quorum2 ORDER BY x;
2018-10-16 10:52:15 +00:00
2020-03-20 00:07:52 +00:00
DROP TABLE quorum1 NO DELAY;
DROP TABLE quorum2 NO DELAY;
SELECT sleep(1) FORMAT Null;