This commit is contained in:
Nikolay Degterinsky 2024-09-18 23:23:56 +03:00 committed by GitHub
commit bf85278dcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,6 +109,9 @@ def test_cluster_groups(started_cluster):
expected_1 = "CREATE TABLE cluster_groups.table_1\\n(\\n `d` Date,\\n `k` UInt64\\n)\\nENGINE = ReplicatedMergeTree(\\'/clickhouse/tables/{uuid}/{shard}\\', \\'{replica}\\')\\nPARTITION BY toYYYYMM(d)\\nORDER BY k\\nSETTINGS index_granularity = 8192"
expected_2 = "CREATE TABLE cluster_groups.table_2\\n(\\n `d` Date,\\n `k` UInt64\\n)\\nENGINE = ReplicatedMergeTree(\\'/clickhouse/tables/{uuid}/{shard}\\', \\'{replica}\\')\\nPARTITION BY toYYYYMM(d)\\nORDER BY k\\nSETTINGS index_granularity = 8192"
for node in [backup_node_1, backup_node_2, main_node_2]:
node.query("SYSTEM SYNC DATABASE REPLICA cluster_groups;")
assert_create_query(all_nodes, "cluster_groups.table_1", expected_1)
assert_create_query(all_nodes, "cluster_groups.table_2", expected_2)
@ -124,3 +127,9 @@ def test_cluster_groups(started_cluster):
main_node_1.query("SYSTEM DROP DATABASE REPLICA '1|2' FROM DATABASE cluster_groups")
assert_eq_with_retry(main_node_1, cluster_query, "main_node_1\n")
# 5. Reset to the original state
backup_node_2.start_clickhouse()
main_node_2.start_clickhouse()
for node in all_nodes:
node.query("DROP DATABASE cluster_groups SYNC;")