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

Allow max_size_to_drop settings in query time #57452

Merged
merged 4 commits into from Dec 19, 2023

Conversation

jrdi
Copy link
Contributor

@jrdi jrdi commented Dec 3, 2023

Changelog category (leave one):

  • Improvement

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

Allow to overwrite max_partition_size_to_drop and max_table_size_to_drop server settings in query time.

Having those settings on the server side is good to avoid removing tables that are too big by mistake. But sometimes users want to remove them for real, and there is no easy way.

@nikitamikhaylov nikitamikhaylov self-assigned this Dec 4, 2023
@nikitamikhaylov nikitamikhaylov added the can be tested Allows running workflows for external contributors label Dec 4, 2023
@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Dec 4, 2023
@robot-clickhouse
Copy link
Member

robot-clickhouse commented Dec 4, 2023

This is an automated comment for commit 1489fc2 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
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 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
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
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
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
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ 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
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

src/Core/Settings.h Outdated Show resolved Hide resolved
@jrdi jrdi force-pushed the query_settings_max_size_drop branch from 283e7c7 to f3a71c2 Compare December 4, 2023 13:11
@jrdi
Copy link
Contributor Author

jrdi commented Dec 5, 2023

CI failures are unrelated:

  • Stateless tests (release, s3 storage) [2/2]: 02676_distinct_reading_in_order_analyzer looks like a glitch with the analyzer
  • Integration tests (asan, analyzer) [6/6]: test_replicated_merge_tree_s3_zero_copy/test.py::test_drop_table at first glance seems related but failed running query system sync replica test_drop_table which seems a temporary failure

@azat
Copy link
Collaborator

azat commented Dec 7, 2023

Having those settings on the server side is good to avoid removing tables that are too big by mistake

Not only, it can be also used to prohibit removal of big "production" tables, and making it a user setting looks slightly unsafe...

Though now ClickHouse support grants, but maybe it is OK to make it query setting not a table setting (like in #56473), since I guess prohibiting DROP explicitly now is the correct way (via GRANT/REVOKE).

@jrdi
Copy link
Contributor Author

jrdi commented Dec 13, 2023

@azat it's OK to prevent users from removing tables by mistake. The thing is that now you have a few options to remove a table that you're sure you want to remove, you have to either increase the server setting, or create the file flag which requires SSH access to the instance.

I'd prefer the query setting over the merge tree setting but I don't care that much for which one we decided to go if we end up with an easier way to drop/truncate tables we are sure we want to remove.

By changes in #57638, looks like this setting is already a query setting in their internal fork. @nikitamikhaylov, what do you think?

@nikitamikhaylov
Copy link
Member

@jrdi Indeed. Let's just resolve conflicts in this PR and merge it.

@jrdi jrdi force-pushed the query_settings_max_size_drop branch 2 times, most recently from e5df1a9 to 463e082 Compare December 15, 2023 14:35
@jrdi jrdi force-pushed the query_settings_max_size_drop branch 2 times, most recently from bd9f049 to 8778d84 Compare December 16, 2023 19:52
@clickhouse-ci clickhouse-ci bot added the manual approve Manual approve required to run CI label Dec 16, 2023
@jrdi jrdi force-pushed the query_settings_max_size_drop branch 2 times, most recently from 239815a to b391275 Compare December 17, 2023 18:11
@jrdi
Copy link
Contributor Author

jrdi commented Dec 18, 2023

A bunch of stateless tests are failing with "Tests are not finished" is this something new? I can't see how the changes in this PR can cause this.

@jrdi jrdi force-pushed the query_settings_max_size_drop branch from b391275 to 1489fc2 Compare December 18, 2023 16:26
@jrdi
Copy link
Contributor Author

jrdi commented Dec 18, 2023

Rebasing from master again since looks like the issues with stateless test have been fixed here #57974

@jrdi
Copy link
Contributor Author

jrdi commented Dec 19, 2023

  • Upgrade check (asan)
  • Upgrade check (tsan)

Both seem unrelated. Checking https://s3.amazonaws.com/clickhouse-test-reports/57452/1489fc2bf74cd5e28f92ffc997a4713f662c3e48/upgrade_check__asan_/test_results.tsv looks like some tables can't be load due to issues with table engine. Probably related to #58026

@nikitamikhaylov nikitamikhaylov merged commit 7c281d9 into ClickHouse:master Dec 19, 2023
264 of 266 checks passed
@jrdi jrdi deleted the query_settings_max_size_drop branch January 5, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants