Skip to content

[RFC] Hide Settings implementation#69213

Merged
Algunenano merged 5 commits intoClickHouse:masterfrom
Algunenano:hide_yo_settings
Sep 19, 2024
Merged

[RFC] Hide Settings implementation#69213
Algunenano merged 5 commits intoClickHouse:masterfrom
Algunenano:hide_yo_settings

Conversation

@Algunenano
Copy link
Copy Markdown
Member

@Algunenano Algunenano commented Sep 3, 2024

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

  • Hide Settings implementation

The idea is that you can include Settings.h to work with a Settings object, without the need to know about its internals, macros or settings declaration. Just declare extern const Settings{Type} name (as we do for ProfileEvents, ErrorCodes, etc) and use the subscript ([]) operator.

Major simplifications would happen in BaseSettings once we remove direct usages.

Good points:

  • Setting struct can be much smaller (future)
  • Way less dependencies on inner details of settings, which means less build time and less rebuilds to add a setting.

Bad points:

  • Need to specify the extern of each setting used in the file. If not done compilation fail, if done incorrectly it will work and it will link but have undefined errors in runtime. This is detected by style check so it should not appear.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

CI Settings (Only check the boxes if you know what you are doing):

  • Allow: All Required Checks
  • Allow: Stateless tests
  • Allow: Stateful tests
  • Allow: Integration Tests
  • Allow: Performance tests
  • Allow: All Builds
  • Allow: batch 1, 2 for multi-batch jobs
  • Allow: batch 3, 4, 5, 6 for multi-batch jobs

  • Exclude: Style check
  • Exclude: Fast test
  • Exclude: All with ASAN
  • Exclude: All with TSAN, MSAN, UBSAN, Coverage
  • Exclude: All with aarch64, release, debug

  • Run only fuzzers related jobs (libFuzzer fuzzers, AST fuzzers, etc.)
  • Exclude: AST fuzzers

  • Do not test
  • Woolen Wolfdog
  • Upload binaries for special builds
  • Disable merge-commit
  • Disable CI cache

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 3, 2024
@robot-clickhouse
Copy link
Copy Markdown
Member

robot-clickhouse commented Sep 3, 2024

This is an automated comment for commit 32de45c 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
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ 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. Integration 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
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
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
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

@antaljanosbenjamin
Copy link
Copy Markdown
Member

checks happen at runtime, not compilation time.

I think this is the biggest drawback of the new approach, the rest (specifiy type, forward declare the used settings) is minor changes in my opinion. However I am happy to try this new approach, because the current approach makes horrible to edit any settings.

@nickitat
Copy link
Copy Markdown
Member

nickitat commented Sep 7, 2024

i wonder how much do you think could help if we just remove all #include <Core/Settings.h> from headers? we will still have 500+ targets that have to be rebuild on any settings change, but at least there will be no "recursive" rebuilds.

@Algunenano Algunenano force-pushed the hide_yo_settings branch 5 times, most recently from 62200d3 to 9f8e02a Compare September 17, 2024 23:48
@Algunenano Algunenano marked this pull request as ready for review September 17, 2024 23:53
@Algunenano Algunenano force-pushed the hide_yo_settings branch 3 times, most recently from ec29805 to f3b05cc Compare September 18, 2024 12:21
@Algunenano
Copy link
Copy Markdown
Member Author

i wonder how much do you think could help if we just remove all #include <Core/Settings.h> from headers? we will still have 500+ targets that have to be rebuild on any settings change, but at least there will be no "recursive" rebuilds.

This was mostly done in #66404. I've removed a few more in this PR, and will continue in other PRs with smaller changes that won't require editing ~500 files anymore.

@Algunenano
Copy link
Copy Markdown
Member Author

Integration tests (tsan) [6/6] — fail: 41, passed: 110
Flaky kafka tests. Works fine in other runs and locally

@Algunenano Algunenano added this pull request to the merge queue Sep 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2024
@Algunenano Algunenano added this pull request to the merge queue Sep 19, 2024
Merged via the queue into ClickHouse:master with commit b4504f2 Sep 19, 2024
@Algunenano Algunenano deleted the hide_yo_settings branch September 19, 2024 12:50
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 19, 2024
baibaichen added a commit to Kyligence/gluten that referenced this pull request Sep 20, 2024
(cherry picked from commit ee116b28b6d8f39cab22d3b6a589a69594d3ccfd)
baibaichen added a commit to Kyligence/gluten that referenced this pull request Sep 20, 2024
(cherry picked from commit 77a02cd273b572672532ca99ee179fd66a6c2e4c)
baibaichen added a commit to apache/gluten that referenced this pull request Sep 20, 2024
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240920)

* Fix build due to ClickHouse/ClickHouse#69213
---------

Co-authored-by: kyligence-git <gluten@kyligence.io>
Co-authored-by: Chang Chen <baibaichen@gmail.com>
sharkdtu pushed a commit to sharkdtu/gluten that referenced this pull request Nov 11, 2024
)

* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240920)

* Fix build due to ClickHouse/ClickHouse#69213
---------

Co-authored-by: kyligence-git <gluten@kyligence.io>
Co-authored-by: Chang Chen <baibaichen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

6 participants