Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSUP-13875: Document the replication_wait_for_inactive_replica_timeout setting #28464

Conversation

sevirov
Copy link
Contributor

@sevirov sevirov commented Sep 1, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category:

Задокументировал две настройки.
@robot-clickhouse robot-clickhouse added the pr-documentation Documentation PRs for the specific code PR label Sep 1, 2021
@tavplubix tavplubix self-assigned this Sep 2, 2021
Поправил ссылки.
sevirov and others added 13 commits September 3, 2021 19:54
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Выполнил перевод на русский язык.
Поправил ссылки.
…-DOCSUP-13875-document_the_replication_wait_for_inactive_replica_timeout_setting
Поправил перевод.
sevirov and others added 7 commits September 8, 2021 19:24
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
@sevirov sevirov marked this pull request as ready for review September 8, 2021 16:26
@sevirov
Copy link
Contributor Author

sevirov commented Sep 8, 2021

@tavplubix Please, review this PR.

@@ -3458,6 +3458,30 @@ Possible values:

Default value: `0`.

## replication_alter_partitions_sync {#replication-alter-partitions-sync}

Determines how actions that manipulate partitions are executed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's also applicable to OPTIMIZE, TRUNCATE and all replicated ALTER queries, not only to ALTER PARTITION

Comment on lines 3467 to 3469
- 0 — Do not wait. The next action can start any time, not waiting for the previous action to be completed.
- 1 — Wait for own execution. The next action on the partition starts only after the previous action is completed on this partition.
- 2 — Wait for everyone. The next action starts only after the previous action is completed on all partitions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "the next action" and "the previous action"?

You can specify how long (in seconds) to wait for inactive replicas to execute all `ALTER` queries with the [replication_wait_for_inactive_replica_timeout seconds](../../../operations/settings/settings.md#replication-wait-for-inactive-replica-timeout) setting.

!!! warning "Warning"
For all `ALTER` queries, if `replication_alter_partitions_sync = 2` and some replicas are not active for more than the time, specified in the `replication_wait_for_inactive_replica_timeout seconds` setting, then an exception `UNFINISHED` is thrown.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's rather a note than a warning

Исправил неточности в описании.
@@ -18,13 +18,17 @@ OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition | PARTITION I

The `OPTMIZE` query is supported for [MergeTree](../../engines/table-engines/mergetree-family/mergetree.md) family, the [MaterializedView](../../engines/table-engines/special/materializedview.md) and the [Buffer](../../engines/table-engines/special/buffer.md) engines. Other table engines aren’t supported.

When `OPTIMIZE` is used with the [ReplicatedMergeTree](../../engines/table-engines/mergetree-family/replication.md) family of table engines, ClickHouse creates a task for merging and waits for execution on all nodes (if the `replication_alter_partitions_sync` setting is enabled).
When `OPTIMIZE` is used with the [ReplicatedMergeTree](../../engines/table-engines/mergetree-family/replication.md) family of table engines, ClickHouse creates a task for merging and waits for execution on all nodes (if the [replication_alter_partitions_sync](../../operations/settings/settings.md#replication-alter-partitions-sync) setting is enabled).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It waits for all replicas if replication_alter_partitions_sync is set to 2 (and waits for current replica if it is set to 1)

Поправил описание запроса OPTIMIZE.
@tavplubix tavplubix merged commit 62b1512 into ClickHouse:master Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-documentation Documentation PRs for the specific code PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants