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

Modify config merging of non-'clickhouse' rooted configs. #52770

Merged
merged 1 commit into from Jul 30, 2023

Conversation

yakov-olkhovskiy
Copy link
Member

@yakov-olkhovskiy yakov-olkhovskiy commented Jul 29, 2023

Changelog category (leave one):

  • Improvement

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

When merging into non-'clickhouse' rooted configuration, configs with different root node name just bypassed without exception.

Closes #50289
Closes #47485

Rationale:
Sometimes we want to assemble configs which have different than 'clickhouse' root node name - for example UDF configuration. According to logic besides immediate config file, we also traverse directories with '<file_name>.d' and 'conf.d' where merging file resides. Also we want to have the same root node name for merging configs. As a result, if we assemble non-'clickhouse' rooted configuration and 'conf.d' in the same directory contains differently rooted config, next exception will be produced:

Processing configuration file 'function.xml'.
Merging configuration file 'conf.d/graphite_rollup.xml'.
2023.07.29 19:25:14.079309 [ 3806116 ] {} <Error> ExternalUserDefinedExecutableFunctionsLoader: Failed to load config file 'function.xml': Poco::Exception. Code: 1000, e.code() = 0, Exception: Failed to merge config with 'conf.d/gr
aphite_rollup.xml': Exception: Root element doesn't have the corresponding root element as the config file. It must be <functions>, Stack trace (when copying this message, always include the lines below):

0. ./build_docker/./src/Common/Config/ConfigProcessor.cpp:0: DB::ConfigProcessor::processConfig(bool*, zkutil::ZooKeeperNodeCache*, std::shared_ptr<Poco::Event> const&) @ 0x00000000157e78d2 in /home/ubuntu/ClickHouse/clickhouse
1. ./build_docker/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:701: DB::ConfigProcessor::loadConfig(bool) @ 0x00000000157e7bb4 in /home/ubuntu/ClickHouse/clickhouse
2. ./build_docker/./contrib/llvm-project/libcxx/include/string:1499: DB::ExternalLoaderXMLConfigRepository::load(String const&) @ 0x0000000013be2745 in /home/ubuntu/ClickHouse/clickhouse
3. ./build_docker/./src/Interpreters/ExternalLoader.cpp:284: DB::ExternalLoader::LoadablesConfigReader::readFileInfo(DB::ExternalLoader::LoadablesConfigReader::FileInfo&, DB::IExternalLoaderConfigRepository&, String const&) const @
 0x0000000013bd96b2 in /home/ubuntu/ClickHouse/clickhouse
4. ./build_docker/./src/Interpreters/ExternalLoader.cpp:223: DB::ExternalLoader::LoadablesConfigReader::readRepositories(std::optional<String> const&, std::optional<String> const&) @ 0x0000000013bd58aa in /home/ubuntu/ClickHouse/cl
ickhouse
5. ./build_docker/./contrib/llvm-project/libcxx/include/optional:260: DB::ExternalLoader::LoadablesConfigReader::read(String const&) @ 0x0000000013bcb920 in /home/ubuntu/ClickHouse/clickhouse
6. ./build_docker/./src/Interpreters/ExternalLoader.cpp:1510: DB::ExternalLoader::addConfigRepository(std::unique_ptr<DB::IExternalLoaderConfigRepository, std::default_delete<DB::IExternalLoaderConfigRepository>>) const @ 0x0000000
013bca1a7 in /home/ubuntu/ClickHouse/clickhouse
7. ./build_docker/./src/Interpreters/Context.cpp:2188: DB::Context::loadOrReloadUserDefinedExecutableFunctions(Poco::Util::AbstractConfiguration const&) @ 0x000000001370f353 in /home/ubuntu/ClickHouse/clickhouse
8. ./build_docker/./programs/server/Server.cpp:1812: DB::Server::main(std::vector<String, std::allocator<String>> const&) @ 0x000000000e9487c3 in /home/ubuntu/ClickHouse/clickhouse
9. ./build_docker/./base/poco/Util/src/Application.cpp:0: Poco::Util::Application::run() @ 0x00000000181dea46 in /home/ubuntu/ClickHouse/clickhouse
10. ./build_docker/./programs/server/Server.cpp:396: DB::Server::run() @ 0x000000000e93669e in /home/ubuntu/ClickHouse/clickhouse
11. ./build_docker/./base/poco/Util/src/ServerApplication.cpp:132: Poco::Util::ServerApplication::run(int, char**) @ 0x00000000181f2179 in /home/ubuntu/ClickHouse/clickhouse
12. ./build_docker/./programs/server/Server.cpp:0: mainEntryClickHouseServer(int, char**) @ 0x000000000e93336a in /home/ubuntu/ClickHouse/clickhouse
13. ./build_docker/./programs/main.cpp:0: main @ 0x0000000008f0e50f in /home/ubuntu/ClickHouse/clickhouse
14. ? @ 0x00007f21e4429d90 in ?
15. __libc_start_main @ 0x00007f21e4429e40 in ?
16. _start @ 0x000000000828b3ae in /home/ubuntu/ClickHouse/clickhouse
 (version 23.7.1.2471 (official build))

This PR resolves this problem by bypassing all non-'clickhouse' rooted configs for non-'clickhouse' assemblies.

@yakov-olkhovskiy yakov-olkhovskiy changed the title Modify config merging non-'clickhouse' rooted configs. Modify config merging of non-'clickhouse' rooted configs. Jul 29, 2023
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-improvement Pull request with some product improvements label Jul 29, 2023
@robot-ch-test-poll2
Copy link
Contributor

robot-ch-test-poll2 commented Jul 29, 2023

This is an automated comment for commit 63b155a with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🟢 success

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
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
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub🟢 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
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

@alexey-milovidov alexey-milovidov self-assigned this Jul 30, 2023
@robot-clickhouse robot-clickhouse merged commit d8a55b2 into master Jul 30, 2023
273 checks passed
@robot-clickhouse robot-clickhouse deleted the config-merge branch July 30, 2023 04:21
@cangyin
Copy link
Contributor

cangyin commented Jul 30, 2023

It seems the PR is just changing an exception into a implicit debug message, this may confuse users if they use same way as #50289, #47485, and may raise another issue like "why my configuration not loaded, even after restarting server"

@yakov-olkhovskiy
Copy link
Member Author

@cangyin unfortunately it's the only option to resolve this issue. This solution is limited for non-'clickhouse' rooted configs - for clickhouse assembly it will still produce a proper exception.

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
Projects
None yet
5 participants