Created
May 23, 2025 20:28
-
-
Save den-crane/702e4c8a1162dae7c2edf48a7c2dd00d to your computer and use it in GitHub Desktop.
system restore replica
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE test(A Int64) | |
ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/test', '{replica}') | |
ORDER BY tuple(); | |
R1: insert into test values(1); detach table test; | |
R2: insert into test values(2); detach table test; | |
SYSTEM DROP REPLICA 'R1' FROM ZKPATH '/clickhouse/tables/test'; | |
SYSTEM DROP REPLICA 'R2' FROM ZKPATH '/clickhouse/tables/test'; | |
R1: attach table test; select count() from test; | |
-- | |
1 | |
R2: attach table test; select count() from test; | |
-- | |
2 | |
R1: system restore replica test; | |
R2: system restore replica test; | |
R1/R2: select count() from test; | |
-- | |
1 | |
R2: select name from system.detached_parts where table = 'test'; | |
-- | |
all_1_1_0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment