This commit is contained in:
nikitamikhaylov 2020-11-23 17:24:32 +03:00
parent 68bef22fda
commit 065cd00257
5 changed files with 12 additions and 12 deletions

View File

@ -2,8 +2,6 @@
<yandex> <yandex>
<profiles> <profiles>
<default> <default>
<optimize_trivial_count_query>1</optimize_trivial_count_query>
<select_sequential_consistency>1</select_sequential_consistency>
</default> </default>
</profiles> </profiles>

View File

@ -13,7 +13,7 @@
<host>zoo3</host> <host>zoo3</host>
<port>2181</port> <port>2181</port>
</node> </node>
<session_timeout_ms>2000</session_timeout_ms> <session_timeout_ms>20000</session_timeout_ms>
</zookeeper> </zookeeper>
</yandex> </yandex>

View File

@ -8,7 +8,7 @@ from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__, zookeeper_config_path='configs/zookeeper.xml') cluster = ClickHouseCluster(__file__, zookeeper_config_path='configs/zookeeper.xml')
node = cluster.add_instance('node', with_zookeeper=True, user_configs=["configs/users.xml"]) node = cluster.add_instance('node', with_zookeeper=True)
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
@ -62,14 +62,16 @@ def test_reload_zookeeper(start_cluster):
## stop all zookeepers, table will be readonly ## stop all zookeepers, table will be readonly
cluster.stop_zookeeper_nodes(["zoo1", "zoo2", "zoo3"]) cluster.stop_zookeeper_nodes(["zoo1", "zoo2", "zoo3"])
node.query("SELECT COUNT() FROM test_table")
with pytest.raises(QueryRuntimeException): with pytest.raises(QueryRuntimeException):
node.query("SELECT COUNT() FROM test_table") node.query("SELECT COUNT() FROM test_table", settings={"select_sequential_consistency" : 1})
## start zoo2, zoo3, table will be readonly too, because it only connect to zoo1 ## start zoo2, zoo3, table will be readonly too, because it only connect to zoo1
cluster.start_zookeeper_nodes(["zoo2", "zoo3"]) cluster.start_zookeeper_nodes(["zoo2", "zoo3"])
wait_zookeeper_node_to_start(["zoo2", "zoo3"]) wait_zookeeper_node_to_start(["zoo2", "zoo3"])
node.query("SELECT COUNT() FROM test_table")
with pytest.raises(QueryRuntimeException): with pytest.raises(QueryRuntimeException):
node.query("SELECT COUNT() FROM test_table") node.query("SELECT COUNT() FROM test_table", settings={"select_sequential_consistency" : 1})
## set config to zoo2, server will be normal ## set config to zoo2, server will be normal
new_config = """ new_config = """

View File

@ -1,8 +1,8 @@
SET send_logs_level = 'fatal'; SET send_logs_level = 'fatal';
DROP TABLE IF EXISTS quorum1; DROP TABLE IF EXISTS quorum1 SYNC;
DROP TABLE IF EXISTS quorum2; DROP TABLE IF EXISTS quorum2 SYNC;
DROP TABLE IF EXISTS quorum3; DROP TABLE IF EXISTS quorum3 SYNC;
CREATE TABLE quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test_01513/sequence_consistency', '1') ORDER BY x PARTITION BY y; CREATE TABLE quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test_01513/sequence_consistency', '1') ORDER BY x PARTITION BY y;
CREATE TABLE quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test_01513/sequence_consistency', '2') ORDER BY x PARTITION BY y; CREATE TABLE quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test_01513/sequence_consistency', '2') ORDER BY x PARTITION BY y;
@ -31,6 +31,6 @@ SELECT count() FROM quorum1;
SELECT count() FROM quorum2; SELECT count() FROM quorum2;
SELECT count() FROM quorum3; SELECT count() FROM quorum3;
DROP TABLE quorum1; DROP TABLE quorum1 SYNC;
DROP TABLE quorum2; DROP TABLE quorum2 SYNC;
DROP TABLE quorum3; DROP TABLE quorum3 SYNC;