Skip to content

#2029 causes problems if CH are deployed behind customized load balancers which define its own user name format #2247

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

Open
FrankChen021 opened this issue Mar 25, 2025 · 1 comment

Comments

@FrankChen021
Copy link

The #2029 updates the code to load server info, and update the client side user as the currentUser() returned from the server.

The code logic looks good if the client side application connects to ClickHouse cluster directly.
However, if multiple ClickHouse clusters are deployed behind a load balaner, there're problems.

In such a case, the load balancer might define the user in a custmized format to contain cluster information for routing like user-cluster,
And it removes the cluster from the user parameter, and then routes queries to corresponding clickhouse clusters directly.

So, user-cluster is the right user name for the client in this case, but the above PR updates the client side user as currentUser(), which is user in this case, for subsquent queries, they will fail at the load balancer side because the user parameter is lack of the cluster information.

So, if the user parameter is given by the user configuration, we should NOT change the user name returned from the server, we SHOULD always use the use name provided by user configuration.

Affected 0.8.1 and above releases

@chernser
Copy link
Contributor

@FrankChen021 Thank you for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants