Closed flaneur2020 closed 1 day ago
Hi @flaneur2020 , the jdbc has handle the logic as same as go driver, maybe you can check here: https://github.com/databendlabs/databend-jdbc/blob/main/databend-client/src/main/java/com/databend/client/DatabendClientV1.java#L312
If so maybe we can delete this?
private static class RouteHint
extends AbstractConnectionProperty<String> {
public RouteHint() {
super("route_hint", NOT_REQUIRED, ALLOWED, STRING_CONVERTER);
}
}
It's no usage.
If so maybe we can delete this?
private static class RouteHint extends AbstractConnectionProperty<String> { public RouteHint() { super("route_hint", NOT_REQUIRED, ALLOWED, STRING_CONVERTER); } }
It's no usage.
if the code is not being referenced, i guess it's good to clean it up 🤔
Hi @flaneur2020 , the jdbc has handle the logic as same as go driver, maybe you can check here: https://github.com/databendlabs/databend-jdbc/blob/main/databend-client/src/main/java/com/databend/client/DatabendClientV1.java#L312
thank you for clarifying this, i believe the behaviour is aligned with the go-driver.
here the implmenetation stores the it in additionalHeaders
, while the go-driver stores it inside a field of the client struct. the final behaviour should be the same.
@TCeason https://github.com/databendlabs/databend-jdbc/pull/281 this pr clean up it, I will close this issue.
on some cases, the server will response a X-Databend-Route-Hint header in the response.
when server responded this header, the client should forget its own generated rout-hint, and remember the route-hint returned from the server.
this header is useful to keep the client session sticky on the same cluster when there're multiple clusters in the server side.
it seems that the jdbc driver still haven't processed this header from the server response yet.
may reference the logic in the go driver: https://github.com/databendlabs/databend-go/blob/main/client.go#L500