Skip to content

Conversation

@AngersZhuuuu
Copy link
Contributor

@AngersZhuuuu AngersZhuuuu commented Nov 19, 2019

What changes were proposed in this pull request?

Hadoop jira: https://issues.apache.org/jira/browse/HADOOP-12911
In this jira, the author said to replace origin Apache Directory project which is not maintained (but not said it won't work well in jdk11) to Apache Kerby which is java binding(fit java version).

And in Flink: apache/flink#9622
Author show the reason why hadoop-2.7.2's MminiKdc failed with jdk11.
Because new encryption types of es128-cts-hmac-sha256-128 and aes256-cts-hmac-sha384-192 (for Kerberos 5) enabled by default were added in Java 11.
Spark with hadoop-2.7's MiniKdcdoes not support these encryption types and does not work well when these encryption types are enabled, which results in the authentication failure.

And when I test hadoop-2.7.2's minikdc in local, the kerberos 's debug error message is read message stream failed, message can't match.

Why are the changes needed?

Support jdk11 with hadoop-2.7

Does this PR introduce any user-facing change?

NO

How was this patch tested?

Existed UT

@AngersZhuuuu
Copy link
Contributor Author

cc @wangyum @dongjoon-hyun
This way can fix error happened in #26533 (comment)

@wangyum
Copy link
Member

wangyum commented Nov 19, 2019

Thank you @AngersZhuuuu

@wangyum
Copy link
Member

wangyum commented Nov 19, 2019

ok to test

@SparkQA
Copy link

SparkQA commented Nov 19, 2019

Test build #114072 has finished for PR 26594 at commit e9ef3ba.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AngersZhuuuu AngersZhuuuu changed the title [test-hadoop3.2][test-java11] Bump MiniKdc to 3.2.0 [SPARK-29957][Build] Bump MiniKdc to 3.2.0 Nov 19, 2019
@wangyum wangyum changed the title [SPARK-29957][Build] Bump MiniKdc to 3.2.0 [SPARK-29957][BUILD][TEST] Bump MiniKdc to 3.2.0 Nov 19, 2019
@wangyum
Copy link
Member

wangyum commented Nov 19, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Nov 19, 2019

Test build #114083 has finished for PR 26594 at commit e9ef3ba.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AngersZhuuuu
Copy link
Contributor Author

strange..I can run these failed UT in local with jdk8/jdk11 success. But failed in Jenkines...

@dongjoon-hyun
Copy link
Member

Retest this please.

@AngersZhuuuu
Copy link
Contributor Author

Retest this please.

For this. I can pass failed UT by run it alone, but will failed when run all UT together.
Seems unit tests affect each other in terms of environment variables. I am checking on this.

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Nov 24, 2019

@AngersZhuuuu . I also tested your PR locally.
That's the reason I re-trigger this. If this fails on my local environment, I didn't trigger an useless run. 😄

BTW, the first failure was KafkaDelegationTokenSuite at last Jenkins run.

@dongjoon-hyun
Copy link
Member

BTW, if you can find a corresponding Apache Hadoop JIRA issue, that will be more persuasive
for this PR.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-29957][BUILD][TEST] Bump MiniKdc to 3.2.0 [SPARK-29957][TEST] Bump MiniKdc to 3.2.0 Nov 24, 2019
pom.xml Outdated
<slf4j.version>1.7.16</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<hadoop.version>2.7.4</hadoop.version>
<miniKdc.version>3.2.0</miniKdc.version>
Copy link
Member

@dongjoon-hyun dongjoon-hyun Nov 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, miniKdc -> minikdc. As you see, Spark-introduced properties are not camelcase like codahale and htmlunit. If needed, we may use -, but I prefer minikdc here in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, miniKdc -> minikdc. As you see, Spark-introduced properties are are camelcase like codahale and htmlunit. If needed, we may use -, but I prefer minikdc here in this case.

Thank you for your careful explanation. Updated.

@AngersZhuuuu
Copy link
Contributor Author

BTW, if you can find a corresponding Apache Hadoop JIRA issue, that will be more persuasive
for this PR.

Hadoop jira: https://issues.apache.org/jira/browse/HADOOP-12911
In this jira, the author said to replace origin Apache Directory project which is not maintained (but not said it won't work well in jdk11) to Apache kerby which is java binding(fit all java version).

And in Flink: apache/flink#9622
Author show the reason why hadoop-2.7.2's MminiKdcfailed with jdk11. Because new encryption types ofes128-cts-hmac-sha256-128andaes256-cts-hmac-sha384-192` (for Kerberos 5) enabled by default were added in Java 11.

And when I test hadoop-2.7.2's minikdc in local, the kerberos 's debug error message is read message stream failed, message can't match.

@dongjoon-hyun
Copy link
Member

Please summarize them into the PR description~

@AngersZhuuuu
Copy link
Contributor Author

Please summarize them into the PR description~

Done

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Nov 24, 2019

Hmm. It seems that KafkaDelegationTokenSuite fails again in Jenkins.

[info] org.apache.spark.sql.kafka010.KafkaDelegationTokenSuite *** ABORTED *** (189 milliseconds)
[info]   java.io.IOException: Could not configure server because SASL configuration did not allow the  ZooKeeper server to authenticate itself properly: javax.security.auth.login.LoginException: kerberos.example.com: Name or service not known

I tested this only at Mac with AdoptOpenJDK8 and 11. How about your environment? I'm wondering if we need to validate this in the linux or not because of the following error message.

javax.security.auth.login.LoginException:
kerberos.example.com: Name or service not known

@SparkQA
Copy link

SparkQA commented Nov 24, 2019

Test build #114327 has finished for PR 26594 at commit e9ef3ba.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AngersZhuuuu
Copy link
Contributor Author

I tested this only at Mac with AdoptOpenJDK8 and 11. How about your environment? I'm wondering if we need to validate this in the linux or not because of the following error message.

I test this in Mac with Oracle Jdk8 and jdk11. I can pass this UT when run it alone.
I can test this in Debian.

My guess is that there were other tests that affected the environment variables

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Nov 24, 2019

Ya. Let me know if you find the root cause. Thanks.

@SparkQA
Copy link

SparkQA commented Nov 24, 2019

Test build #114329 has finished for PR 26594 at commit 3ec2891.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 24, 2019

Test build #114339 has finished for PR 26594 at commit 2e282f2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 24, 2019

Test build #114340 has finished for PR 26594 at commit a224fad.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 30, 2019

Test build #114658 has finished for PR 26594 at commit 476d60e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum wangyum changed the title [SPARK-29957][TEST][test-java11][test-hadoop3.2][test-maven] Reset MiniKDC's default enctypes to fit jdk8/jdk11 [SPARK-29957][TEST][test-java11] Reset MiniKDC's default enctypes to fit jdk8/jdk11 Dec 1, 2019
@wangyum
Copy link
Member

wangyum commented Dec 1, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Dec 1, 2019

Test build #114677 has finished for PR 26594 at commit 476d60e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gaborgsomogyi
Copy link
Contributor

I think the test comment is not yet resolved: https://github.com/apache/spark/pull/26594/files#r350680194

@AngersZhuuuu
Copy link
Contributor Author

@gaborgsomogyi @wangyum How about current way ?
If don't have a libdefaults section , we add one at krb5.conf's header

@SparkQA
Copy link

SparkQA commented Dec 4, 2019

Test build #114848 has finished for PR 26594 at commit b782e99.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 4, 2019

Test build #114850 has finished for PR 26594 at commit 10a0006.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 4, 2019

Test build #114851 has finished for PR 26594 at commit 03f7fb1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gaborgsomogyi
Copy link
Contributor

The approach looks good, there are still no tests...

@AngersZhuuuu
Copy link
Contributor Author

The approach looks good, there are still no tests...

Here is in UT ..., I really don't know how to add UT for this, so handle it in if condition when there are no libdefaults in krb5.conf

@SparkQA
Copy link

SparkQA commented Dec 5, 2019

Test build #114884 has finished for PR 26594 at commit e252dd0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

// scalastyle:off println
writer.println(krb5confStr)
// scalastyle:on println
writer.close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use Files.write(content, file, StandardCharsets.UTF_8) instead of println?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-    val writer = new PrintWriter(kdc.getKrb5conf)
-    // scalastyle:off println
-    writer.println(krb5confStr)
-    // scalastyle:on println
-    writer.close()
+    Files.write(krb5confStr, kdc.getKrb5conf, StandardCharsets.UTF_8)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use Files.write(content, file, StandardCharsets.UTF_8) instead of println?

Done thanks.

@SparkQA
Copy link

SparkQA commented Dec 6, 2019

Test build #114926 has finished for PR 26594 at commit 223533f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-29957][TEST][test-java11] Reset MiniKDC's default enctypes to fit jdk8/jdk11 [SPARK-29957][TEST] Reset MiniKDC's default enctypes to fit jdk8/jdk11 Dec 6, 2019
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Merged to master. Thank you, @AngersZhuuuu and all.

@gatorsmile
Copy link
Member

Thanks, everyone! This is a great fix!

attilapiros pushed a commit to attilapiros/spark that referenced this pull request Dec 6, 2019
### What changes were proposed in this pull request?

Hadoop jira: https://issues.apache.org/jira/browse/HADOOP-12911
In this jira, the author said to replace origin Apache Directory project which is not maintained (but not said it won't work well in jdk11) to Apache Kerby which is java binding(fit java version).

And in Flink: apache/flink#9622
Author show the reason why hadoop-2.7.2's  `MminiKdc` failed with jdk11.
Because new encryption types of `es128-cts-hmac-sha256-128` and `aes256-cts-hmac-sha384-192` (for Kerberos 5) enabled by default were added in Java 11.
Spark with `hadoop-2.7's MiniKdc`does not support these encryption types and does not work well when these encryption types are enabled, which results in the authentication failure.

And when I test hadoop-2.7.2's minikdc in local, the kerberos 's debug error message is  read message stream failed, message can't match.

### Why are the changes needed?
Support jdk11 with hadoop-2.7

### Does this PR introduce any user-facing change?
NO

### How was this patch tested?
Existed UT

Closes apache#26594 from AngersZhuuuu/minikdc-3.2.0.

Lead-authored-by: angerszhu <[email protected]>
Co-authored-by: AngersZhuuuu <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants