This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new 31bee36bba2 HBASE-29117 Kerby version conflict with Hadoop 3.4 (#6686)
31bee36bba2 is described below
commit 31bee36bba299e0670cc2160de16beaf877e545d
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 7343973add2..aa9787292eb 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 c6edd80faa3..cc0260cdee9 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>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
@@ -344,6 +339,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>
@@ -387,6 +387,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 fff02910dde..fe24ac0406e 100644
--- a/hbase-http/pom.xml
+++ b/hbase-http/pom.xml
@@ -100,21 +100,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>
@@ -381,6 +371,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 c57a896c8c0..198ae40c4e0 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 eec2dd5ddd7..b60ae8a790b 100644
--- a/hbase-server/pom.xml
+++ b/hbase-server/pom.xml
@@ -272,16 +272,6 @@
<artifactId>hamcrest-library</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>
@@ -796,6 +786,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 51a1110077a..443c4817557 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 049ed345f93..b94a2ea7414 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 3669f721fc0..b12862578e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1422,21 +1422,6 @@
<version>${bouncycastle.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>
@@ -3929,6 +3914,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>
@@ -4280,6 +4284,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>
@@ -4540,6 +4552,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>