This is an automated email from the ASF dual-hosted git repository.

dengzh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 8d7c9c42f76 HIVE-29304: HS2 fails to start if cluster is configured 
with a mix of LDAP and Kerberos (#6166)
8d7c9c42f76 is described below

commit 8d7c9c42f76bbd0a258640b038ac305b9e71169d
Author: dengzh <[email protected]>
AuthorDate: Thu Nov 13 09:14:07 2025 +0800

    HIVE-29304: HS2 fails to start if cluster is configured with a mix of LDAP 
and Kerberos (#6166)
---
 jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java | 2 +-
 service/src/java/org/apache/hive/service/server/HiveServer2.java  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java 
b/jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
index 6ab722b7371..00ef4785a70 100644
--- a/jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
+++ b/jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java
@@ -208,7 +208,7 @@ static void configureConnParams(JdbcConnectionParams 
connParams) throws ZooKeepe
       try (CuratorFramework zooKeeperClient = getZkClient(connParams)) {
         final List<String> serverHosts = getServerHosts(connParams, 
zooKeeperClient);
         if (serverHosts.isEmpty()) {
-          throw new ZooKeeperHiveClientException("No more HiveServer2 URIs 
from ZooKeeper to attempt");
+          throw new ZooKeeperHiveClientException("Empty HiveServer2 URIs found 
from ZooKeeper to attempt");
         }
         // Pick a server node randomly
         final String serverNode = 
serverHosts.get(ThreadLocalRandom.current().nextInt(serverHosts.size()));
diff --git a/service/src/java/org/apache/hive/service/server/HiveServer2.java 
b/service/src/java/org/apache/hive/service/server/HiveServer2.java
index c145283c120..ced00eeb100 100644
--- a/service/src/java/org/apache/hive/service/server/HiveServer2.java
+++ b/service/src/java/org/apache/hive/service/server/HiveServer2.java
@@ -99,6 +99,7 @@
 import org.apache.hadoop.hive.ql.txn.compactor.Worker;
 import org.apache.hadoop.hive.shims.ShimLoader;
 import org.apache.hadoop.hive.common.IPStackUtils;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.ExitUtil;
 import org.apache.hive.common.util.HiveStringUtils;
 import org.apache.hive.common.util.HiveVersionInfo;
@@ -606,7 +607,7 @@ public static boolean isAllTransportMode(HiveConf hiveConf) 
{
 
   private ACLProvider getACLProvider(HiveConf hiveConf) {
     final boolean isSecure =
-        AuthType.isKerberosAuthMode(hiveConf) &&
+        UserGroupInformation.isSecurityEnabled() &&
         HiveConf.getBoolVar(hiveConf, 
HiveConf.ConfVars.HIVE_ZOOKEEPER_USE_KERBEROS);
 
     return new ACLProvider() {
@@ -683,7 +684,7 @@ private void addConfsToPublish(HiveConf hiveConf, 
Map<String, String> confsToPub
    */
   private static void setUpZooKeeperAuth(HiveConf hiveConf) {
     try {
-      if (AuthType.isKerberosAuthMode(hiveConf) &&
+      if (UserGroupInformation.isSecurityEnabled() &&
           StringUtils.isNotEmpty(HiveConf.getVar(hiveConf, 
HiveConf.ConfVars.HIVE_ZOOKEEPER_QUORUM)) &&
           HiveConf.getBoolVar(hiveConf, 
HiveConf.ConfVars.HIVE_ZOOKEEPER_USE_KERBEROS)) {
         // Install the JAAS Configuration for the runtime

Reply via email to