Skip to content

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

@FrankChen021

Description

@FrankChen021

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions