ClickHouse/docs/en/sql-reference/statements
Mike Kot 4c391f8e99
SYSTEM RESTORE REPLICA replica [ON CLUSTER cluster] (#13652)
* initial commit: add setting and stub

* typo

* added test stub

* fix

* wip merging new integration test and code proto

* adding steps interpreters

* adding firstly proposed solution (moving parts etc)

* added checking zookeeper path existence

* fixing the include

* fixing and sorting includes

* fixing outdated struct

* fix the name

* added ast ptr as level of indirection

* fix ref

* updating the changes

* working on test stub

* fix iterator -> reference

* revert rocksdb submodule update

* fixed show privileges test

* updated the test stub

* replaced rand() with thread_local_rng(), updated the tests

updated the test

fixed test config path

test fix

removed error messages

fixed the test

updated the test

fixed string literal

fixed literal

typo: =

* fixed the empty replica error message

* updated the test and the code with logs

* updated the possible test cases, updated

* added the code/test milestone comments

* updated the test (added more testcases)

* replaced native assert with CH one

* individual replicas recursive delete fix

* updated the AS db.name AST

* two small logging fixes

* manually generated AST fixes

* Updated the test, added the possible algo change

* Some thoughts about optimizing the solution:

ALTER MOVE PARTITION .. TO TABLE -> move to detached/ + ALTER ... ATTACH

* fix

* Removed the replica sync in test as it's invalid

* Some test tweaks

* tmp

* Rewrote the algo by using the executeQuery instead of

hand-crafting the ASTPtr.

Two questions still active.

* tr: logging active parts

* Extracted the parts moving algo into a separate helper function

* Fixed the test data and the queries slightly

* Replaced query to system.parts to direct invocation,

started building the test that breaks on various parts.

* Added the case for tables when at least one replica is alive

* Updated the test to test replicas restoration by detaching/attaching

* Altered the test to check restoration without replica restart

* Added the tables swap in the start if the server failed last time

* Hotfix when only /replicas/replica... path was deleted

* Restore ZK paths while creating a replicated MergeTree table

* Updated the docs, fixed the algo for individual replicas restoration case

* Initial parts table storage fix, tests sync fix

* Reverted individual replica restoration to general algo

* Slightly optimised getDataParts

* Trying another solution with parts detaching

* Rewrote algo without any steps, added ON CLUSTER support

* Attaching parts from other replica on restoration

* Getting part checksums from ZK

* Removed ON CLUSTER, finished working solution

* Multiple small changes after review

* Fixing parallel test

* Supporting rewritten form on cluster

* Test fix

* Moar logging

* Using source replica as checksum provider

* improve test, remove some code from parser

* Trying solution with move to detached + forget

* Moving all parts (not only Committed) to detached

* Edited docs for RESTORE REPLICA

* Re-merging

* minor fixes

Co-authored-by: Alexander Tokmakov <avtokmakov@yandex-team.ru>
2021-06-20 11:24:43 +03:00
..
alter minor fix 2021-06-03 12:27:17 +00:00
create Merge pull request #24548 from kirillikoff/DOCSUP-9474-document-table-comments 2021-05-31 11:11:27 +03:00
select Merge pull request #24586 from romainneutron/polish-english-doc 2021-05-28 00:16:16 +03:00
attach.md SYSTEM RESTORE REPLICA replica [ON CLUSTER cluster] (#13652) 2021-06-20 11:24:43 +03:00
check-table.md Avoid short syntax 2021-05-27 21:44:11 +02:00
describe-table.md DOCSUP-2806: Add meta header in RU (#15801) 2020-10-26 13:29:30 +03:00
detach.md Avoid short syntax 2021-05-27 21:44:11 +02:00
drop.md Avoid short syntax 2021-05-27 21:44:11 +02:00
exists.md Avoid short syntax 2021-05-27 21:44:11 +02:00
explain.md Update explain.md 2021-05-27 20:41:25 +03:00
grant.md Avoid short syntax 2021-05-27 21:44:11 +02:00
index.md DOCSUP-4193: Document the EXPLAIN statement (#17734) 2020-12-04 21:24:05 +03:00
insert-into.md Merge pull request #24586 from romainneutron/polish-english-doc 2021-05-28 00:16:16 +03:00
kill.md Avoid short syntax 2021-05-27 21:44:11 +02:00
misc.md [docs] split misc statements (#12403) 2020-07-11 14:05:49 +03:00
optimize.md Merge pull request #24084 from atereh/terehova-DOCSUP-5919-query_optimize_upd_description 2021-06-01 13:50:01 +03:00
rename.md Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into dmozhaeva-DOCSUP-8448-russian 2021-05-28 12:04:58 +03:00
revoke.md DOCSUP-2806: Add meta header in RU (#15801) 2020-10-26 13:29:30 +03:00
set-role.md DOCSUP-2806: Add meta header in RU (#15801) 2020-10-26 13:29:30 +03:00
set.md DOCSUP-2806: Add meta header in RU (#15801) 2020-10-26 13:29:30 +03:00
show.md DOCSUP-6543: Edit and translate Show Clusters and MergeTree (#24130) 2021-06-15 15:21:44 +03:00
system.md SYSTEM RESTORE REPLICA replica [ON CLUSTER cluster] (#13652) 2021-06-20 11:24:43 +03:00
truncate.md Adding a note that Buffer engine does not support TRUNCATE statement 2021-05-12 11:00:13 +05:00
use.md DOCSUP-2806: Add meta header in RU (#15801) 2020-10-26 13:29:30 +03:00
watch.md LIVE-представления, изменение перевода 2021-03-27 21:57:04 +03:00