mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
ISSUES-2581 add test
This commit is contained in:
parent
1c51407fa7
commit
58c2bd366f
@ -0,0 +1,6 @@
|
||||
3
|
||||
3
|
||||
4
|
||||
4
|
||||
4
|
||||
|
@ -0,0 +1,40 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
||||
|
||||
CREATE TABLE test.quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '1') ORDER BY x PARTITION BY y;
|
||||
CREATE TABLE test.quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '2') ORDER BY x PARTITION BY y;
|
||||
|
||||
SET insert_quorum=2;
|
||||
SET select_sequential_consistency=1;
|
||||
|
||||
INSERT INTO test.quorum2 VALUES (1, '15-10-2018');
|
||||
INSERT INTO test.quorum2 VALUES (2, '15-10-2018');
|
||||
INSERT INTO test.quorum2 VALUES (2, '15-11-2018');
|
||||
|
||||
SET insert_quorum_timeout=100;
|
||||
|
||||
SYSTEM STOP FETCHES test.quorum1;
|
||||
|
||||
INSERT INTO test.quorum2 VALUES (1, '15-12-2018'); -- { serverError 319 } --
|
||||
|
||||
SELECT count(*) FROM test.quorum1;
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
SET select_sequential_consistency=0;
|
||||
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
SET select_sequential_consistency=1;
|
||||
|
||||
SET insert_quorum_timeout=100;
|
||||
|
||||
SYSTEM START FETCHES test.quorum1;
|
||||
SYSTEM SYNC REPLICA test.quorum1;
|
||||
|
||||
SELECT count(*) FROM test.quorum1;
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
@ -0,0 +1,5 @@
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
@ -0,0 +1,36 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
||||
|
||||
CREATE TABLE test.quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '1') ORDER BY x PARTITION BY y;
|
||||
CREATE TABLE test.quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '2') ORDER BY x PARTITION BY y;
|
||||
|
||||
SET insert_quorum=2;
|
||||
SET select_sequential_consistency=1;
|
||||
|
||||
SET insert_quorum_timeout=0;
|
||||
|
||||
SYSTEM STOP FETCHES test.quorum1;
|
||||
|
||||
INSERT INTO test.quorum2 VALUES (1, '15-11-2018'); -- { serverError 319 } --
|
||||
|
||||
SELECT count(*) FROM test.quorum1;
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
SET select_sequential_consistency=0;
|
||||
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
SET select_sequential_consistency=1;
|
||||
|
||||
SET insert_quorum_timeout=100;
|
||||
|
||||
SYSTEM START FETCHES test.quorum1;
|
||||
SYSTEM SYNC REPLICA test.quorum1;
|
||||
|
||||
SELECT count(*) FROM test.quorum1;
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
@ -0,0 +1,3 @@
|
||||
2
|
||||
2
|
||||
|
@ -0,0 +1,19 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
||||
|
||||
CREATE TABLE test.quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '1') ORDER BY x PARTITION BY y;
|
||||
CREATE TABLE test.quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '2') ORDER BY x PARTITION BY y;
|
||||
|
||||
SET insert_quorum=2;
|
||||
SET select_sequential_consistency=1;
|
||||
|
||||
INSERT INTO test.quorum1 VALUES (1, '15-11-2018');
|
||||
INSERT INTO test.quorum1 VALUES (2, '15-11-2018');
|
||||
|
||||
SELECT count(*) FROM test.quorum1;
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
@ -0,0 +1,4 @@
|
||||
3
|
||||
3
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
||||
|
||||
CREATE TABLE test.quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/fetches', '1') ORDER BY x PARTITION BY y;
|
||||
CREATE TABLE test.quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/fetches', '2') ORDER BY x PARTITION BY y;
|
||||
|
||||
SET insert_quorum=2;
|
||||
SET select_sequential_consistency=1;
|
||||
|
||||
INSERT INTO test.quorum1 VALUES (1, '15-11-2018');
|
||||
INSERT INTO test.quorum1 VALUES (2, '15-11-2018');
|
||||
INSERT INTO test.quorum1 VALUES (1, '15-12-2018');
|
||||
|
||||
SELECT count(*) FROM test.quorum1;
|
||||
SELECT count(*) FROM test.quorum2;
|
||||
|
||||
DROP TABLE IF EXISTS test.quorum1;
|
||||
DROP TABLE IF EXISTS test.quorum2;
|
Loading…
Reference in New Issue
Block a user