2021-09-12 12:35:27 +00:00
|
|
|
-- Tags: zookeeper
|
|
|
|
|
2021-02-12 19:42:20 +00:00
|
|
|
DROP TABLE IF EXISTS sample_table;
|
|
|
|
|
|
|
|
CREATE TABLE sample_table (
|
|
|
|
key UInt64
|
|
|
|
)
|
2021-08-05 06:55:07 +00:00
|
|
|
ENGINE ReplicatedMergeTree('/clickhouse/{database}/01700_system_zookeeper_path_in/{shard}', '{replica}')
|
2021-02-12 19:42:20 +00:00
|
|
|
ORDER BY tuple();
|
|
|
|
|
2023-11-17 13:45:19 +00:00
|
|
|
SELECT name FROM system.zookeeper WHERE path = '/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard') AND name like 'block%' ORDER BY name;
|
|
|
|
SELECT 'r1' FROM system.zookeeper WHERE path = '/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard') || '/replicas' AND name LIKE '%'|| getMacro('replica') ||'%' ORDER BY name;
|
2021-03-19 04:24:43 +00:00
|
|
|
|
2021-02-12 19:42:20 +00:00
|
|
|
SELECT '========';
|
2023-11-17 13:45:19 +00:00
|
|
|
SELECT name FROM system.zookeeper WHERE path IN ('/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard')) AND name LIKE 'block%' ORDER BY name;
|
|
|
|
SELECT 'r1' FROM system.zookeeper WHERE path IN ('/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard') || '/replicas') AND name LIKE '%' || getMacro('replica') || '%' ORDER BY name;
|
2021-02-12 19:42:20 +00:00
|
|
|
SELECT '========';
|
2023-11-17 13:45:19 +00:00
|
|
|
SELECT name FROM system.zookeeper WHERE path IN ('/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard'),
|
|
|
|
'/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard') || '/replicas') AND name LIKE 'block%' ORDER BY name;
|
2021-02-12 19:42:20 +00:00
|
|
|
SELECT '========';
|
2023-11-17 13:45:19 +00:00
|
|
|
SELECT name FROM system.zookeeper WHERE path IN (SELECT concat('/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard') || '/', name)
|
|
|
|
FROM system.zookeeper WHERE (name != 'replicas' AND name NOT LIKE 'leader_election%' AND name NOT LIKE 'zero_copy_%' AND path = '/clickhouse/' || currentDatabase() || '/01700_system_zookeeper_path_in/' || getMacro('shard'))) ORDER BY name;
|
2021-02-12 19:42:20 +00:00
|
|
|
|
|
|
|
DROP TABLE IF EXISTS sample_table;
|