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

Fix clickhouse-keeper-client symlink #54587

Merged
merged 1 commit into from Sep 18, 2023
Merged

Conversation

deric
Copy link
Contributor

@deric deric commented Sep 13, 2023

Since #50964 got merged there's

$ clickhouse-keeper client 

command which makes the clickhouse-keeper-client symlink obsolete.

Moreover clickhouse-keeper package contains following files:

$ dpkg-query -L clickhouse-keeper
/etc
/etc/clickhouse-keeper
/etc/clickhouse-keeper/keeper_config.xml
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/clickhouse-keeper.service
/usr
/usr/bin
/usr/bin/clickhouse-keeper
/usr/share
/usr/share/doc
/usr/share/doc/clickhouse-keeper
/usr/share/doc/clickhouse-keeper/AUTHORS
/usr/share/doc/clickhouse-keeper/CHANGELOG.md
/usr/share/doc/clickhouse-keeper/LICENSE
/usr/share/doc/clickhouse-keeper/README.md
/usr/bin/clickhouse-keeper-client
/usr/bin/clickhouse-keeper-converter

which means that the symlink would be broken anyway (unless some other package provides /usr/bin/clickhouse binary)

$ ll /usr/bin/clickhouse*
-rwxr-xr-x 1 root root 25580984 Sep  4 18:09 /usr/bin/clickhouse-keeper*
lrwxrwxrwx 1 root root       10 Sep  4 18:31 /usr/bin/clickhouse-keeper-client -> clickhouse
lrwxrwxrwx 1 root root       10 Sep  4 18:31 /usr/bin/clickhouse-keeper-converter -> clickhouse

Same applies for clickhouse-keeper-converter symlink.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

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

Remove redundant clickhouse-keeper-client symlink

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

@CLAassistant
Copy link

CLAassistant commented Sep 13, 2023

CLA assistant check
All committers have signed the CLA.

@tavplubix
Copy link
Member

tavplubix commented Sep 13, 2023

Let's keep the symlink, so both clickhouse-keeper client and clickhouse-keeper-client will work. But we need to fix the broken link

cc: @pufit

@deric
Copy link
Contributor Author

deric commented Sep 13, 2023

I'm afraid simple symlink won't do, clickhouse-keeper-client would need to be defined e.g. as:

#!/bin/bash
clickhouse-keeper client "$@"

@Felixoid
Copy link
Member

Here's what I've done and it works

docker run -it --rm ubuntu:22.04 bash
root@6cf7f71b05f1:/# apt update && apt install curl
root@6cf7f71b05f1:/# curl -O https://packages.clickhouse.com/deb/pool/main/c/clickhouse/clickhouse-keeper_23.8.2.7_amd64.deb
root@6cf7f71b05f1:/# dpkg -i clickhouse-keeper_23.8.2.7_amd64.deb
root@6cf7f71b05f1:/# clickhouse-keeper client
Coordination::Exception: All connection tries failed while connecting to ZooKeeper. nodes: [::1]:9181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 23.8.2.7 (official build)), [::1]:9181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 23.8.2.7 (official build)), [::1]:9181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 23.8.2.7 (official build)), [::1]:9181

root@6cf7f71b05f1:/# clickhouse-keeper-client
bash: clickhouse-keeper-client: command not found
root@6cf7f71b05f1:/# ln -sf /usr/bin/clickhouse-keeper usr/bin/clickhouse-keeper-client
root@6cf7f71b05f1:/# clickhouse-keeper-client
Coordination::Exception: All connection tries failed while connecting to ZooKeeper. nodes: [::1]:9181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 23.8.2.7 (official build)), [::1]:9181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 23.8.2.7 (official build)), [::1]:9181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 23.8.2.7 (official build)), [::1]:9181

root@6cf7f71b05f1:/# ln -sf /usr/bin/clickhouse-keeper usr/bin/clickhouse-keeper-converter
root@6cf7f71b05f1:/# clickhouse-keeper-converter
Processing configuration file 'keeper_config.xml'.
Code: 107. DB::Exception: Configuration file keeper_config.xml doesn't exist and there is no embedded config. (FILE_DOESNT_EXIST), Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000000e1185b in /usr/bin/clickhouse-keeper
1. DB::Exception::Exception<String const&>(int, FormatStringHelperImpl<std::type_identity<String const&>::type>, String const&) @ 0x000000000078f9cd in /usr/bin/clickhouse-keeper
2. DB::ConfigProcessor::processConfig(bool*, zkutil::ZooKeeperNodeCache*, std::shared_ptr<Poco::Event> const&) @ 0x0000000000db77b7 in /usr/bin/clickhouse-keeper
3. DB::ConfigProcessor::loadConfig(bool) @ 0x0000000000db8b34 in /usr/bin/clickhouse-keeper
4. BaseDaemon::initialize(Poco::Util::Application&) @ 0x0000000000a28231 in /usr/bin/clickhouse-keeper
5. DB::Keeper::initialize(Poco::Util::Application&) @ 0x0000000000b4d2c3 in /usr/bin/clickhouse-keeper
6. Poco::Util::Application::run() @ 0x0000000000fb6dfa in /usr/bin/clickhouse-keeper
7. DB::Keeper::run() @ 0x0000000000b4d11e in /usr/bin/clickhouse-keeper
8. Poco::Util::ServerApplication::run(int, char**) @ 0x0000000000fcdf19 in /usr/bin/clickhouse-keeper
9. mainEntryClickHouseKeeper(int, char**) @ 0x0000000000b4c098 in /usr/bin/clickhouse-keeper
10. main @ 0x0000000000b5ae79 in /usr/bin/clickhouse-keeper
 (version 23.8.2.7 (official build))

So, symlinks should be fixed, and not removed. Good catch, thanks!

Copy link
Member

@Felixoid Felixoid left a comment

Choose a reason for hiding this comment

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

Please, bring the symlink back with the correct src clickhouse-keeper

packages/clickhouse-keeper.yaml Outdated Show resolved Hide resolved
@Felixoid Felixoid self-assigned this Sep 16, 2023
@deric deric changed the title Remove clickhouse-keeper-client symlink Fix clickhouse-keeper-client symlink Sep 18, 2023
@deric
Copy link
Contributor Author

deric commented Sep 18, 2023

@Felixoid You're right, that's definitely a better solution.

@deric deric requested a review from Felixoid September 18, 2023 08:44
@Felixoid Felixoid added the can be tested Allows running workflows for external contributors label Sep 18, 2023
@robot-clickhouse robot-clickhouse added pr-build Pull request with build/testing/packaging improvement pr-status-⏳ PR with some pending statuses labels Sep 18, 2023
@robot-clickhouse
Copy link
Member

robot-clickhouse commented Sep 18, 2023

This is an automated comment for commit 7a12488 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
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
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
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
SQLTestThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ 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
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
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
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

@Felixoid Felixoid added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Sep 18, 2023
@Felixoid Felixoid merged commit 8752a79 into ClickHouse:master Sep 18, 2023
83 of 178 checks passed
@robot-ch-test-poll1 robot-ch-test-poll1 added pr-status-❌ PR with some error/faliure statuses and removed pr-status-⏳ PR with some pending statuses labels Sep 18, 2023
alexey-milovidov added a commit that referenced this pull request Sep 18, 2023
Backport #54587 to 23.8: Fix clickhouse-keeper-client symlink
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 18, 2023
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 pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-build Pull request with build/testing/packaging improvement pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-status-❌ PR with some error/faliure statuses
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants