-
Notifications
You must be signed in to change notification settings - Fork 1
Client fault tolerant connection by multiple hosts #13
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
base: updated-master
Are you sure you want to change the base?
Conversation
a3e748c
to
94e48b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add description
programs/client/Client.cpp
Outdated
if (options.count("host")) | ||
{ | ||
hosts_ports = options["host"].as<std::vector<HostPort>>(); | ||
config().setString("host", hosts_ports[0].host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You set it here, but anyway you do it later in a round robin loop. Do you really need it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to set "host" before round-robin, because I need to create ConnectionParameters(config())
in connect
method. I thought, that it would be better to set config()
before calling connect
.
94e48b0
to
962d851
Compare
fix the run command and add example
Before this patch current_user/current_address will be preserved from the previous query. Signed-off-by: Azat Khuzhin <[email protected]>
Co-authored-by: Azat Khuzhin <[email protected]>
Update list-versions.sh, update version_date.tsv
…-for-show-grants Fix checking grants for SHOW GRANTS
Cmake leftovers cleanup
…ssword Add 'clickhouse-client --password' comment to the scripts used in Qui…
Disable data skipping indexes by default for queries with FINAL
Support async inserts in clickhouse-client for queries with inlined data
3253ae1
to
c1df291
Compare
…rays Fix consecutive backward seeks in seekable read buffers
…database-memory Fix wrong engine in SHOW CREATE DATABASE with engine Memory ClickHouse#34225
Add table function format(format_name, data)
Add options for clickhouse-format.
Add composability to casting and index operators
Fix clang tidy
…-fault-tolerant-connection
Support UUID in MsgPack format
…temp-tables-via-grpc Fix inserting to temporary tables via gRPC.
Update clickhouse-keeper.md
…metadata Better local metadata comparison with ZooKeeper metadata
Fix segfault in schema inference from url
add function addressToLineWithInlines
Fix various issues when projection is enabled by default
Method called on already moved
Use UTC in docker images
Revert "Merge pull request ClickHouse#34373 from ClickHouse/docker-tz"
Add submodule minizip
…-fault-tolerant-connection
Changelog category (leave one):
New Feature
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Parameter
--host
can accept multiple hosts. In case of unavailability of one of them, the client will try to connect to the next one.Detailed description / Documentation draft:
Feature accept setting multiple hosts for connection. It approves fault tolerance of connection because when one host isn't alive client can try to connect to another one.
Parameter
--host
can accept multiple addresses. Every address must contain resolvable host and can also contain portif it isn't set, port from--port
is used). Example of usage:clickhouse-client --host host1:1 host2 host3:3 --port 2 --query "SELECT 1"
When multiple addresses are passed to the host argument and the first one is unavailable, the client will try to connect to the next one (round robin approach). In the example, if client can't connect to
host1:1
, it will try to connect tohost2
and port2
, which is set in--port
.