Skip to content

Client fault tolerant connection by multiple hosts - #13

Open
df530 wants to merge 1424 commits into
updated-masterfrom
client-fault-tolerant-connection
Open

Client fault tolerant connection by multiple hosts#13
df530 wants to merge 1424 commits into
updated-masterfrom
client-fault-tolerant-connection

Conversation

@df530

@df530df530 commented Jan 19, 2022

Copy link
Copy Markdown
Collaborator

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 to host2 and port 2, which is set in --port.

By adding documentation, you'll allow users to try your new feature immediately, not when someone else will have time to document it later. Documentation is necessary for all features that affect user experience in any way. You can add brief documentation draft above, or add documentation right into your patch as Markdown files in docs folder.

If you are doing this for the first time, it's recommended to read the lightweight Contributing to ClickHouse Documentation guide first.

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

@df530df530 changed the title Client fault tolerant connectionTest PRJan 19, 2022
@df530
df530force-pushed the client-fault-tolerant-connection branch 2 times, most recently from a3e748c to 94e48b0CompareJanuary 19, 2022 22:33
@df530df530 changed the title Test PRClient fault tolerant connection by multiple hostsJan 19, 2022

@PolyProgrammistPolyProgrammist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add description

Comment threadprograms/client/Client.cpp Outdated

Copy link
Copy Markdown
Member

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?

@df530df530Jan 19, 2022

Copy link
Copy Markdown
CollaboratorAuthor

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.

@df530
df530force-pushed the client-fault-tolerant-connection branch from 94e48b0 to 962d851CompareJanuary 20, 2022 09:54
andycoland others added 24 commits February 2, 2022 14:32
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 <a.khuzhin@semrush.com>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Update list-versions.sh, update version_date.tsv
…-for-show-grants
Fix checking grants for SHOW GRANTS
…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
@df530
df530force-pushed the client-fault-tolerant-connection branch from 3253ae1 to c1df291CompareFebruary 7, 2022 23:04
alexey-milovidovand others added 26 commits February 8, 2022 02:27
…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 composability to casting and index operators
…temp-tables-via-grpc
Fix inserting to temporary tables via gRPC.
…metadata
Better local metadata comparison with ZooKeeper metadata
Fix various issues when projection is enabled by default
Revert "Merge pull request ClickHouse#34373 from ClickHouse/docker-tz"
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20 participants

@df530@PolyProgrammist@andycol@azat@Felixoid@kssenii@KochetovNicolai@CurtizJ@FArthur-cmd@codyrobert@alexey-milovidov@kitaisreal@danlark1@alesapin@evillique@flickerbox-tom@tavplubix@sdil@cmsxbc@ucasfl