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

drop keeper dir with zero copy locks #57575

Merged
merged 3 commits into from Mar 6, 2024
Merged

Conversation

CheSema
Copy link
Member

@CheSema CheSema commented Dec 6, 2023

Changelog category (leave one):

  • Improvement

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

All zero copy locks related to a table have to be dropped when the table is dropped. The directory which contains these locks has to be removed also.

Closes #58964

@robot-ch-test-poll robot-ch-test-poll added the pr-not-for-changelog This PR should not be mentioned in the changelog label Dec 6, 2023
@robot-ch-test-poll
Copy link
Contributor

robot-ch-test-poll commented Dec 6, 2023

This is an automated comment for commit 8b2bd21 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
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
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
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ 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 keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe 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
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✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ 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
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✅ success
Check nameDescriptionStatus
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⏳ pending
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

@CheSema
Copy link
Member Author

CheSema commented Dec 15, 2023

2023.12.12 13:37:35.346461 [ 2015 ] {d91457b8-36e4-4178-8a26-e86c14439ee2} <Trace> test_duj5lca0.r1: Removing zookeeper lock /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0/common_ods_ttjpicrygutbejnfhxvwucbawbasm/1 for part all_0_0_0 (files to keep: [])
2023.12.12 13:37:35.347578 [ 1304 ] {} <Trace> KeeperDispatcher: Processing requests batch, size: 1, bytes: 132
2023.12.12 13:37:35.348206 [ 2104 ] {8ceb8b4b-cf22-47d2-b3f7-b1f2bcb166a6} <Trace> test_duj5lca0.r2: Removing zookeeper lock /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0/common_ods_ttjpicrygutbejnfhxvwucbawbasm/2 for part all_0_0_0 (files to keep: [])
2023.12.12 13:37:35.349543 [ 1304 ] {} <Trace> KeeperDispatcher: Processing requests batch, size: 1, bytes: 132
2023.12.12 13:37:35.353302 [ 2015 ] {d91457b8-36e4-4178-8a26-e86c14439ee2} <Trace> test_duj5lca0.r1: No more children left for /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0/common_ods_ttjpicrygutbejnfhxvwucbawbasm, will try to remove the whole node
2023.12.12 13:37:35.453134 [ 1304 ] {} <Trace> KeeperDispatcher: Processing requests batch, size: 1, bytes: 130
2023.12.12 13:37:35.453765 [ 2104 ] {8ceb8b4b-cf22-47d2-b3f7-b1f2bcb166a6} <Trace> test_duj5lca0.r2: No more children left for /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0/common_ods_ttjpicrygutbejnfhxvwucbawbasm, will try to remove the whole node
2023.12.12 13:37:35.455338 [ 1304 ] {} <Trace> KeeperDispatcher: Processing requests batch, size: 1, bytes: 130
2023.12.12 13:37:35.456430 [ 2015 ] {d91457b8-36e4-4178-8a26-e86c14439ee2} <Trace> test_duj5lca0.r1: Removed last parent zookeeper lock /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0/common_ods_ttjpicrygutbejnfhxvwucbawbasm for part all_0_0_0 with id common_ods_ttjpicrygutbejnfhxvwucbawbasm
2023.12.12 13:37:35.467031 [ 2104 ] {8ceb8b4b-cf22-47d2-b3f7-b1f2bcb166a6} <Trace> test_duj5lca0.r2: Node with parent zookeeper lock /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0/common_ods_ttjpicrygutbejnfhxvwucbawbasm for part all_0_0_0 with id common_ods_ttjpicrygutbejnfhxvwucbawbasm doesn't exist
2023.12.12 13:37:35.471349 [ 2015 ] {d91457b8-36e4-4178-8a26-e86c14439ee2} <Trace> test_duj5lca0.r1: Removed last parent zookeeper lock /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0 for part all_0_0_0 (part is finally unlocked)
2023.12.12 13:37:35.473244 [ 2104 ] {8ceb8b4b-cf22-47d2-b3f7-b1f2bcb166a6} <Warning> test_duj5lca0.r2: Node with parent zookeeper lock /clickhouse/zero_copy/zero_copy_s3/0e09012d-51e4-415d-a7eb-0a0eb655da55/all_0_0_0/common_ods_ttjpicrygutbejnfhxvwucbawbasm for part all_0_0_0 doesn't exist (part was unlocked before), refuse to remove blobs
2023.12.12 13:37:35.474074 [ 2104 ] {8ceb8b4b-cf22-47d2-b3f7-b1f2bcb166a6} <Trace> test_duj5lca0.r2: Blobs of part all_0_0_0 cannot be removed

This is the race from tests. It has nothing with the changes, but still.

  • The tests failed, it needs to be adjusted.
  • That messages are misleading like some blobs are left abandoned on S3. In fact, r1 deleted the blobs correctly.
2023.12.12 13:37:35.495188 [ 2015 ] {d91457b8-36e4-4178-8a26-e86c14439ee2} <Debug> S3ObjectStorage: Objects with paths [common/ods/ttjpicrygutbejnfhxvwucbawbasm, common/buy/helktkorhdpxvovelwattwkzbefao, common/gjd/vwzrqpawvmcokqhghiryjzvbdkyxf, common/sle/dzdyuffybeavcfzeiyrspkcvgjpgg, common/pve/fwbwgbwnujlaxuwwtgvqgoiqolzcw, common/hfb/uxtqhfvqiapykrfbekcommeojkyti, common/iap/kwtgcdlgnziplajaxmwrjdhsbuggu] were removed from S3
2023.12.12 13:37:35.495783 [ 2015 ] {d91457b8-36e4-4178-8a26-e86c14439ee2} <Debug> RemoveManyObjectStorageOperation: metadata and objects were removed for [data/test_duj5lca0/r1/delete_tmp_all_0_0_0/checksums.txt, data/test_duj5lca0/r1/delete_tmp_all_0_0_0/columns.txt, data/test_duj5lca0/r1/delete_tmp_all_0_0_0/count.txt, data/test_duj5lca0/r1/delete_tmp_all_0_0_0/n.bin, data/test_duj5lca0/r1/delete_tmp_all_0_0_0/n.cmrk2, data/test_duj5lca0/r1/delete_tmp_all_0_0_0/default_compression_codec.txt, data/test_duj5lca0/r1/delete_tmp_all_0_0_0/metadata_version.txt], only metadata were removed for [].
2023.12.12 13:37:35.496754 [ 2015 ] {d91457b8-36e4-4178-8a26-e86c14439ee2} <Trace> test_duj5lca0.r1: dropAllData: removing all data parts from memory.

@CheSema
Copy link
Member Author

CheSema commented Dec 15, 2023

something strange in ClickHouse Stateless Tests (tsan, S3 Storage). There is Fatal caused by Logical Error. But no stack trace for it.

2023.12.12 21:13:37.685565 [ 11090 ] {2f4806c7-42de-4a91-b3ea-d4c1ff3ade86} <Trace> test_cw8qzrvk.alter_table0 (ff6abe32-074c-455f-8dce-1d7a97cb8e7f) (Replicated OutputStream): ZooKeeperWithFaultInjection call FAILED: seed=1377394408167778856 func=tryMulti path=/clickhouse/tables/02443_detach_attach_partition_test_cw8qzrvk/alter_table/bloc
ks/all_8490796596548189825_9107552674774882560 code=No node message=Coordination error: No node, path /clickhouse/tables/02443_detach_attach_partition_test_cw8qzrvk/alter_table/block_numbers/all/block-0000000013

Definetly an error in response is expected.
But

2023.12.12 21:13:37.711823 [ 11090 ] {2f4806c7-42de-4a91-b3ea-d4c1ff3ade86} <Fatal> : Logical error: 'There is no failed OpResult'.

Turned out this is an known issue.
#50465

@CheSema
Copy link
Member Author

CheSema commented Dec 15, 2023

@CheSema CheSema force-pushed the chesema-drop-zk-table-node branch 3 times, most recently from 17f6619 to 67e3af9 Compare December 18, 2023 14:22
@CheSema
Copy link
Member Author

CheSema commented Dec 19, 2023

Stateless Tests (release, S3 Storage)
all 4 failed tests are about this -- #57984

@tavplubix tavplubix self-assigned this Dec 19, 2023
Comment on lines 1126 to 1121
else if (code != Coordination::Error::ZOK)
{
LOG_ERROR(logger, "Zero copy locks were not completely removed from ZooKeeper, "
"{} still exists and may contain some garbage.", zero_copy_locks_root);
throw zkutil::KeeperException::fromPath(code, zero_copy_locks_root);
}
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be impossible:

/// Doesn't throw in the following cases:
/// * The node doesn't exist
/// * Versions don't match
/// * The node has children.
Coordination::Error tryRemove(const std::string & path, int32_t version = -1);

Copy link
Member

Choose a reason for hiding this comment

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

But it makes sense to write this message if tryRemoveRecursive returns false

Copy link
Member Author

@CheSema CheSema Dec 27, 2023

Choose a reason for hiding this comment

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

Do you mean that the is no other reason for code != Coordination::Error::ZOK after I handle ZNOTEMPTY and ZNONODE in the if-branches before?
Honestly I wrote that branch as a save ending of handling the errors. Just to be sure that all statuses are handled. This is why there is exception 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.

yes (and since you don't pass a version to tryRemove)

@hamidtahi
Copy link

Hi, is there an ETA for this to be merged?

@CheSema CheSema force-pushed the chesema-drop-zk-table-node branch from 67e3af9 to 54bc462 Compare March 5, 2024 12:13
@CheSema CheSema force-pushed the chesema-drop-zk-table-node branch from 54bc462 to 8b2bd21 Compare March 5, 2024 18:07
@robot-ch-test-poll robot-ch-test-poll added pr-improvement Pull request with some product improvements and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Mar 5, 2024
@CheSema CheSema merged commit 8ac2ef6 into master Mar 6, 2024
238 of 244 checks passed
@CheSema CheSema deleted the chesema-drop-zk-table-node branch March 6, 2024 16:43
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some zookeeper znodes can remain after database or table are dropped
6 participants