Skip to content

Use JDK 11 for Helix Project#2384

Merged
xyuanlu merged 5 commits intoapache:masterfrom
desaikomal:jdk11
Feb 28, 2023
Merged

Use JDK 11 for Helix Project#2384
xyuanlu merged 5 commits intoapache:masterfrom
desaikomal:jdk11

Conversation

@desaikomal
Copy link
Contributor

@desaikomal desaikomal commented Feb 24, 2023

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

Description

Helix has been using JDK 1.8. We want to move to latest JDK but prior to that, we can use JDK11 as intermediate step. This will help us remain current and use all the language optimizations for performance improvements.

We were using Jetty - 9.4.48.v20220622 and Jersey version 2.15.
Both these versions were not compatible with JDK11.
If you go with the latest version of Jetty and latest of Jersey, the REST Server never starts.
So we need to do 2 levels of compatibility:

  • with JDK 11 compatibility
  • compatibility amongst both of them.

It took me while to figure out Jetty/Jersey compatibility. In addition some APIs had changed.

Tests

  • The following is the result of the "mvn test" command on the appropriate module:
    [ERROR] Failures:
    [ERROR] TestNoThrottleDisabledPartitions.testDisablingTopStateReplicaByDisablingInstance:98 expected: but was:
    [ERROR] TestNoThrottleDisabledPartitions.testNoThrottleOnDisabledInstance:231->setupEnvironment:317->setupCluster:436 » ZkClient
    [ERROR] TestP2PNoDuplicatedMessage.testP2PStateTransitionEnabled:180 expected: but was:
    [ERROR] TestMultiZkConnectionConfig>MultiZkTestBase.afterClass:137 expected: but was:
    [ERROR] TestMultiZkConnectionConfig.testZKHelixManager:295->Object.wait:328->Object.wait:-2 » ThreadTimeout
    [ERROR] TestWagedRebalanceFaultZone.testAddZone:270->validate:318->validateZoneAndTagIsolation:342 expected:<3> but was:<2>
    [ERROR] TestTaskStateModelFactory.testZkClientCreationMultiZk:80 » Bind Address alread...
    [INFO]
    [ERROR] Tests run: 1325, Failures: 7, Errors: 0, Skipped: 6

I ran all the 7 failures as independent test-runs. Some tests passed on running while some failed. I took a fresh code branch with no changes and ran the same failed tests against it and they failed there as well. So between re-run and clean branch, there are NO NEW failures.

PR-CI run is completely GREEN (including all other components)
https://github.com/apache/helix/actions/runs/4289361614

Changes that Break Backward Compatibility (Optional)

  • My PR contains changes that break backward compatibility or previous assumptions for certain methods or API. They include:

(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

(Link the GitHub wiki you added)

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

@rahulrane50
Copy link
Contributor

rahulrane50 commented Feb 24, 2023

Not an expert here but just curious don't we need few other changes like adding new dependencies in jdk 11, GC options and few newer APIs changes. (reference : https://gist.github.com/dineshbhagat/97eff450e9edbd7d006deb35f28e3fd4)

@desaikomal
Copy link
Contributor Author

JDK11 - optimization work can start once we have the base line.

Copy link
Contributor

@qqu0127 qqu0127 left a comment

Choose a reason for hiding this comment

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

There is a huge file helix-core/error that was added by accident?


public void setupSslServer(int port, SslContextFactory sslContextFactory) {

public void setupSslServer(int port, SslContextFactory.Server sslContextFactory) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat : If Now parent factory class is deprecated and directly server and client class are encouraged to access then should we rename this variable as well to "sslContextServer"? Also may be update documentation/comments here?

Copy link
Contributor

@rahulrane50 rahulrane50 left a comment

Choose a reason for hiding this comment

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

Thanks for starting this @desaikomal overall LGTM!.

Copy link
Contributor

@qqu0127 qqu0127 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

Copy link
Contributor

@junkaixue junkaixue left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for working on this!

Copy link
Contributor

@mgao0 mgao0 left a comment

Choose a reason for hiding this comment

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

LGTM, could you please add some explanation in the PR description about the jetty and jersey problem, just for future reference.

@desaikomal
Copy link
Contributor Author

Thank you all (@junkaixue , @mgao0 , @rahulrane50 , @qqu0127 ) for the review.
Change has been approved by @junkaixue , @mgao0 , @rahulrane50 and @qqu0127. Commit message : Upgrading Helix to use JDK 11.

@xyuanlu xyuanlu merged commit a180628 into apache:master Feb 28, 2023
rahulrane50 pushed a commit to rahulrane50/helix that referenced this pull request May 31, 2023
Upgrading Helix to use JDK 11.

Co-authored-by: Komal Desai <kdesai@kdesai-mn1.linkedin.biz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants