-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for HTTP/HTTPS protocol for ClickHouse connection #938
base: main
Are you sure you want to change the base?
Add support for HTTP/HTTPS protocol for ClickHouse connection #938
Conversation
Before this change, Quesma supported only the "clickhouse://" protocol to connect to ClickHouse. However, ClickHouse also supports the HTTP protocol (8123) and HTTPS protocol (8443). This PR extends the ClickHouse connection logic to switch to using HTTP(S) protocol if the user put that endpoint instead. This change is motivated by the fact that the HTTPS endpoint is the first/default endpoint shown on ClickHouse Cloud and by the fact that we saw a user try to use the HTTP endpoint.
@mieciu I vaguely remember you mentioning something about |
e97a153
to
17ef2cd
Compare
20df302
to
ba73ad3
Compare
So far we didn't really care about the protocol prefix - once connection has been established with host we relied on driver defaults, so that'd be something to check. I'm not sure if querying over http protocol is supported there. |
This PR improves the validation of connection URLs in configuration, giving clearer error messages to the user and the expected format of the connection string. Related to that, RemoteLogDrainUrl and QuesmaInternalTelemetryUrl now can't be provided in the config - they were overwritten by hardcoded constants either way. Additionally, ClickHouse connection doctor is improved: - If connection succeeded it suggests making sure that username/password is correct - It now skips TLS trial connections if the user disabled TLS in the config (and informs of that fact) - It tries default ports in more cases This PR is extracted from larger PR QuesmaOrg#938.
Since there are some quirks with HTTP(S) in Hydrolix and this PR might not be mergable as-is, I extracted only the validation improvements to this (mergable) PR #946 |
This PR improves the validation of connection URLs in configuration, giving clearer error messages to the user and the expected format of the connection string. Related to that, RemoteLogDrainUrl and QuesmaInternalTelemetryUrl now can't be provided in the config - they were overwritten by hardcoded constants either way. Additionally, ClickHouse connection doctor is improved: - If connection succeeded it suggests making sure that username/password is correct - It now skips TLS trial connections if the user disabled TLS in the config (and informs of that fact) - It tries default ports in more cases This PR is extracted from larger PR QuesmaOrg#938.
And the quirks are:
|
Yea just to leave trace after our investigation:
This discrepancy is related to differences in how queries over http are handled in both DBs. Relevant sources: ClickHouse / Hydrolix. |
This PR improves the validation of connection URLs in configuration, giving clearer error messages to the user and the expected format of the connection string. Related to that, RemoteLogDrainUrl and QuesmaInternalTelemetryUrl now can't be provided in the config - they were overwritten by hardcoded constants either way. Additionally, ClickHouse connection doctor is improved: - If connection succeeded it suggests making sure that username/password is correct - It now skips TLS trial connections if the user disabled TLS in the config (and informs of that fact) - It tries default ports in more cases This PR is extracted from larger PR #938.
This PR adds support for the HTTP (port 8123)/HTTPS (port 8443) protocol to connect to ClickHouse (in addition to the already supported
clickhouse://
(port 9000) protocol).This change is motivated by the fact that the HTTPS endpoint is the first/default endpoint shown on ClickHouse Cloud and by the fact that we saw a user try to use the HTTP endpoint.
Additionally this PR improves the "ClickHouse Connection Doctor" code and the validation of user-provided connection URLs. Related to that,
RemoteLogDrainUrl
andQuesmaInternalTelemetryUrl
now can't be provided in the config - they were overwritten by hardcoded constants either way.