dengzhhu653 commented on code in PR #5217: URL: https://github.com/apache/hive/pull/5217#discussion_r1582010976
########## jdbc/src/java/org/apache/hive/jdbc/Utils.java: ########## @@ -725,15 +725,21 @@ private static String getAuthorityFromJdbcURL(String uri) throws JdbcUriParseExc * explored. Also update the host, port, jdbcUriString and other configs published by the server. * * @param connParams + * @param info * @return true if new server info is retrieved successfully */ - static boolean updateConnParamsFromZooKeeper(JdbcConnectionParams connParams) { + static boolean updateConnParamsFromZooKeeper(JdbcConnectionParams connParams, Properties info) throws JdbcUriParseException { // Add current host to the rejected list connParams.getRejectedHostZnodePaths().add(connParams.getCurrentHostZnodePath()); String oldServerHost = connParams.getHost(); int oldServerPort = connParams.getPort(); // Update connection params (including host, port) from ZooKeeper try { + // We should reset sessionVars to the original client configurations to + // avoid the rejected server-side sessionVars affecting next server. + JdbcConnectionParams originalConnParams = extractURLComponents(connParams.getJdbcUriString(), info); + connParams.getSessionVars().clear(); Review Comment: I think all other vars remain the same, so instead of parsing the connection url again, I mean cloud we just `connParams.getSessionVars().remove(JdbcConnectionParams.AUTH_PRINCIPAL)` so that the `ZooKeeperHiveClientHelper` can reset the `AUTH_PRINCIPAL`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org