This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.5 by this push:
new 96f114c5803 HBASE-29117 Kerby version conflict with Hadoop 3.4 (#6686)
96f114c5803 is described below
commit 96f114c5803e1e5c5d647b9ae48281b324f5af9e
Author: Duo Zhang <[email protected]>
AuthorDate: Fri Feb 14 22:06:18 2025 +0800
HBASE-29117 Kerby version conflict with Hadoop 3.4 (#6686)
Use hadoop-minikdc instead of depending on kerby directly
Signed-off-by: Andrew Purtell <[email protected]>
Signed-off-by: Wei-Chiu Chuang <[email protected]>
(cherry picked from commit 60113344095284875c3e057ec7109a6251512ec0)
---
hbase-asyncfs/pom.xml | 15 ++----
hbase-common/pom.xml | 15 ++++--
.../hadoop/hbase/util/SimpleKdcServerUtil.java | 10 ++--
hbase-http/pom.xml | 15 ++----
hbase-rest/pom.xml | 15 ++----
hbase-server/pom.xml | 15 ++----
hbase-testing-util/pom.xml | 22 +++------
hbase-thrift/pom.xml | 5 --
pom.xml | 54 ++++++++++++++++------
9 files changed, 78 insertions(+), 88 deletions(-)
diff --git a/hbase-asyncfs/pom.xml b/hbase-asyncfs/pom.xml
index abc9d760186..c6704a09512 100644
--- a/hbase-asyncfs/pom.xml
+++ b/hbase-asyncfs/pom.xml
@@ -78,16 +78,6 @@
<artifactId>bcprov-jdk18on</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-http</artifactId>
@@ -198,6 +188,11 @@
<artifactId>hadoop-minikdc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-simplekdc</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 427893f68e2..b8124a67c9a 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -155,11 +155,6 @@
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
@@ -334,6 +329,11 @@
<!--FYI This pulls in hadoop's guava. Its needed for Configuration
at least-->
</dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-simplekdc</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -377,6 +377,11 @@
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-minikdc</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git
a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
index fa3172e3b14..d1ac19bd8ad 100644
---
a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
+++
b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/SimpleKdcServerUtil.java
@@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.util;
import java.io.File;
import java.io.IOException;
-import java.net.BindException;
import java.net.InetAddress;
import java.util.function.Supplier;
import org.apache.hadoop.hbase.net.BoundSocketMaker;
@@ -85,12 +84,9 @@ public final class SimpleKdcServerUtil {
if (kdc != null) {
kdc.stop();
}
- if (ke.getCause() != null && ke.getCause() instanceof BindException) {
- LOG.info("Clashed using port {}; getting a new random port",
kdcPort);
- continue;
- } else {
- throw ke;
- }
+ // new kerby just eats the cause exception so we can not test for
BindException any more.
+ // the only way is to always retry...
+ LOG.info("Failed to init/start kdc server, retry = {}", i, ke);
} finally {
if (bsm != null) {
bsm.close();
diff --git a/hbase-http/pom.xml b/hbase-http/pom.xml
index f85b56f5e1b..497fdf3b371 100644
--- a/hbase-http/pom.xml
+++ b/hbase-http/pom.xml
@@ -87,21 +87,11 @@
<optional>true</optional>
</dependency>
<!-- Test dependencies -->
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-core</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
@@ -368,6 +358,11 @@
<artifactId>hadoop-minikdc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-simplekdc</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml
index 77984664357..248f8e38daa 100644
--- a/hbase-rest/pom.xml
+++ b/hbase-rest/pom.xml
@@ -194,16 +194,6 @@
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-core</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
@@ -445,6 +435,11 @@
<artifactId>hadoop-minikdc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-simplekdc</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</profile>
<!--
diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml
index b8dbc457588..36ec9fc2f9e 100644
--- a/hbase-server/pom.xml
+++ b/hbase-server/pom.xml
@@ -277,16 +277,6 @@
<artifactId>bcprov-jdk18on</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
@@ -791,6 +781,11 @@
<artifactId>hadoop-minikdc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-simplekdc</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/hbase-testing-util/pom.xml b/hbase-testing-util/pom.xml
index 2e971e0f6dd..9eee689406a 100644
--- a/hbase-testing-util/pom.xml
+++ b/hbase-testing-util/pom.xml
@@ -272,6 +272,12 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-minikdc</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-simplekdc</artifactId>
+ <scope>compile</scope>
</dependency>
</dependencies>
</profile>
@@ -333,22 +339,6 @@
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-minikdc</artifactId>
<scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk15</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-client</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <scope>compile</scope>
</dependency>
</dependencies>
</profile>
diff --git a/hbase-thrift/pom.xml b/hbase-thrift/pom.xml
index 88f1066da28..6680fe88e69 100644
--- a/hbase-thrift/pom.xml
+++ b/hbase-thrift/pom.xml
@@ -117,11 +117,6 @@
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
diff --git a/pom.xml b/pom.xml
index 6b42f331e62..6ed4913b7fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1398,21 +1398,6 @@
<version>${skyscreamer.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-core</artifactId>
- <version>${kerby.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-client</artifactId>
- <version>${kerby.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.kerby</groupId>
- <artifactId>kerb-simplekdc</artifactId>
- <version>${kerby.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-crypto</artifactId>
@@ -3905,6 +3890,25 @@
<artifactId>hadoop-hdfs-client</artifactId>
<version>${hadoop-two.version}</version>
</dependency>
+ <!--
+ for hadoop 2.x, we need to manually depend on kerby
+ -->
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-core</artifactId>
+ <version>${kerby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-client</artifactId>
+ <version>${kerby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kerby</groupId>
+ <artifactId>kerb-simplekdc</artifactId>
+ <version>${kerby.version}</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
</profile>
@@ -4256,6 +4260,14 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jline</groupId>
+ <artifactId>jline</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -4516,6 +4528,18 @@
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk15</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.apache.directory.api</groupId>
+ <artifactId>api-all</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jline</groupId>
+ <artifactId>jline</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>