This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.2 by this push:
new 6f8c62a428c branch-4.2: [fix](fe) Preserve Kerberos authentication in
HDFS storage vaults #70320 (#70418)
6f8c62a428c is described below
commit 6f8c62a428cc552ea0f6f39a72747bc3eae797d2
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Nov 23 21:23:51 2026 +0800
branch-4.2: [fix](fe) Preserve Kerberos authentication in HDFS storage
vaults #70320 (#70418)
Cherry-picked from #70320
Co-authored-by: deardeng <[email protected]>
---
.../java/org/apache/doris/catalog/HdfsStorageVault.java | 3 +++
.../apache/doris/cloud/catalog/HdfsStorageVaultTest.java | 15 +++++++++++++++
2 files changed, 18 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsStorageVault.java
b/fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsStorageVault.java
index c41d4540716..a96c3614194 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsStorageVault.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsStorageVault.java
@@ -189,6 +189,9 @@ public class HdfsStorageVault extends StorageVault {
"%s is required for kerberos",
PropertyKey.HADOOP_KERBEROS_PRINCIPAL);
Preconditions.checkArgument(lowerCaseKeys.contains(PropertyKey.HADOOP_KERBEROS_KEYTAB),
"%s is required for kerberos",
PropertyKey.HADOOP_KERBEROS_KEYTAB);
+
hdfsConfBuilder.addHdfsConfs(Cloud.HdfsBuildConf.HdfsConfKVPair.newBuilder()
+ .setKey(PropertyKey.HADOOP_SECURITY_AUTHENTICATION)
+
.setValue(property.getValue().toLowerCase(Locale.ROOT)));
} else if
(property.getKey().equalsIgnoreCase(PropertyKey.HADOOP_KERBEROS_PRINCIPAL)) {
Preconditions.checkArgument(!Strings.isNullOrEmpty(property.getValue()),
"%s is null or empty", property.getKey());
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/cloud/catalog/HdfsStorageVaultTest.java
b/fe/fe-core/src/test/java/org/apache/doris/cloud/catalog/HdfsStorageVaultTest.java
index 231858830bc..9b226f05575 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/cloud/catalog/HdfsStorageVaultTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/cloud/catalog/HdfsStorageVaultTest.java
@@ -65,6 +65,21 @@ public class HdfsStorageVaultTest {
return vault;
}
+ @Test
+ public void testGenerateHdfsParamPreservesKerberosAuthentication() {
+ String authKey =
HdfsStorageVault.PropertyKey.HADOOP_SECURITY_AUTHENTICATION;
+ Cloud.HdfsBuildConf buildConf =
HdfsStorageVault.generateHdfsParam(ImmutableMap.of(
+ authKey.toUpperCase(Locale.ROOT), "KERBEROS",
+ HdfsStorageVault.PropertyKey.HADOOP_KERBEROS_PRINCIPAL,
"hdfs/[email protected]",
+ HdfsStorageVault.PropertyKey.HADOOP_KERBEROS_KEYTAB,
"/etc/krb5.keytab")).getBuildConf();
+
+ Assertions.assertEquals("hdfs/[email protected]",
buildConf.getHdfsKerberosPrincipal());
+ Assertions.assertEquals("/etc/krb5.keytab",
buildConf.getHdfsKerberosKeytab());
+
Assertions.assertEquals(List.of(Cloud.HdfsBuildConf.HdfsConfKVPair.newBuilder()
+ .setKey(authKey)
+ .setValue("kerberos").build()), buildConf.getHdfsConfsList());
+ }
+
@Test
public void testAlterMetaServiceNormal() throws Exception {
new MockUp<MetaServiceProxy>(MetaServiceProxy.class) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]