Skip to content

Improve keeper failure injection and tolerance - #56389

Closed
Algunenano wants to merge 29 commits into
ClickHouse:masterfrom
Algunenano:backups_fault
Closed

Algunenano wants to merge 29 commits into
ClickHouse:masterfrom
Algunenano:backups_fault

Conversation

@Algunenano

@Algunenano Algunenano commented Nov 6, 2023 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Backward Incompatible Change

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

  • Reworked tolerance to keeper failures
    • Deprecated insert_keeper_*, backup_restore_keeper*, distributed_ddl_keeper_* settings. They have been replaced by common settings (keeper_max_retries, keeper_fault_injection_probability...) that work in any (supported) operation.
    • Backups (ON CLUSTER): Fix reconnection after keeper failure
    • Insert/attach (replicated) parts: Made them more reliable to keeper failures. If the connection to keeper fails when pushing metadata, it will now be able to retry if the data wasn't written (before it would only continue if it was written).
    • Insert/attach (replicated) parts with quorum: The process can now recover from keeper failures when verifying the quorum.
    • CI: Increment the ratio of keeper failures (from 1% to 10%) to help catch more errors. Made them also retry faster so it don't affect timings too much.

Documentation entry for user-facing changes

@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-improvement Pull request with some product improvements label Nov 6, 2023
@robot-ch-test-poll3

robot-ch-test-poll3 commented Nov 6, 2023 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit 706b1c9 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker image for serversThe check to build and optionally push the mentioned image to docker hub✅ success
Docs CheckBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub✅ success
SQLTestThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
SQLancerFuzzing tests that detect logical bugs with SQLancer tool✅ success
SqllogicRun clickhouse on the sqllogic test set against sqlite and checks that all statements are passed✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Check nameDescriptionStatus
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc❌ failure
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Mergeable CheckChecks if all other necessary checks are successful❌ failure
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests❌ failure
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors❌ failure
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts❌ failure

@Algunenano
Algunenano force-pushed the backups_fault branch 2 times, most recently from 7c91a6e to 83aa5f5 Compare November 9, 2023 15:49
@Algunenano

Copy link
Copy Markdown
Member Author

My philosophy behind this PR has become "given enough retries allowed, CH should be able to recover from any keeper HW error". It's going to be painful. I'll need to limit the scope to what's already there and then try to introduce retries on other parts as needed.

@jrdi

jrdi commented Nov 10, 2023

Copy link
Copy Markdown
Contributor

So this PR is not about backups anymore, right? Happy to see the effort on improving ZK retries, thanks for this!

@Algunenano

Copy link
Copy Markdown
Member Author

So this PR is not about backups anymore, right?

No, it's still about backups, but backups do many different operations :D I want to investigate if there is a simpler way to introduce both keeper faults and retries in more places

@devcrafter devcrafter self-assigned this Nov 12, 2023
@devcrafter

Copy link
Copy Markdown
Member

So this PR is not about backups anymore, right?

No, it's still about backups, but backups do many different operations :D I want to investigate if there is a simpler way to introduce both keeper faults and retries in more places

I'd suggest doing it gradually, in general. But first need to look at the changes in more details.

@Algunenano

Copy link
Copy Markdown
Member Author

I'd suggest doing it gradually, in general. But first need to look at the changes in more details.

👍 I'm starting by adding (always disabled) faults to ReplicatedMergeTree. It means using ZooKeeperWithFaultInjection instead of Zookeeper in lots of calls

@robot-ch-test-poll3 robot-ch-test-poll3 added the submodule changed At least one submodule changed in this PR. label Nov 13, 2023
@robot-ch-test-poll1 robot-ch-test-poll1 removed the submodule changed At least one submodule changed in this PR. label Nov 13, 2023
@Algunenano Algunenano changed the title Improve keeper failure tolerance in backups Improve keeper failure injection and tolerance Nov 14, 2023
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-backward-incompatible Pull request with backwards incompatible changes and removed pr-improvement Pull request with some product improvements labels Nov 14, 2023
@devcrafter

Copy link
Copy Markdown
Member

@Algunenano imo, you're doing too much at once here. Items you list in the Changelog entry above can be done in separate PRs.

@Algunenano

Copy link
Copy Markdown
Member Author

The tests should be green right now (there might be some that I've broken with more failures, but let's see). I'm pushing some extra changes to see what happens when we add faults also to async keeper requests and I'll start moving subset of changes into smaller PRs so it's easier to review and reason about.

@Algunenano

Copy link
Copy Markdown
Member Author

Quorum handling moved to #57986. The only thing missing from this draft is the unification of settings to have only a single set of settings for zk faults and retries for all operations: now only backup and insert, but ideally more will be added.

@Algunenano Algunenano closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backward-incompatible Pull request with backwards incompatible changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants