wForget commented on code in PR #5217: URL: https://github.com/apache/hive/pull/5217#discussion_r1582014641
########## 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: Sorry, I rethought it, it might not be good to remove `AUTH_PRINCIPAL` directly, we need to follow user configuration priority. It is possible that we configured `AUTH_PRINCIPAL` in the url instead of getting it from previous server zk data. -- 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