New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[improve][build] PIP-156 Build Pulsar Server on Java 17 #15264
Conversation
2f7d18f
to
c17f0bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must create a matrix test suite where we run the Pulsar client suite with jdk8 and jdk17 to ensure compatibility
...ntegration/src/test/java/org/apache/pulsar/tests/integration/io/sinks/KinesisSinkTester.java
Outdated
Show resolved
Hide resolved
Yes, that is a part of the plan. I was focusing on the build upgrade and regression checks first. After I confirm that the existing tests pass, I will start to add the |
3e4b302
to
b354245
Compare
9fd4075
to
77ef2f5
Compare
@heesung-sn Just that you know about it, it's usually useful to work on GitHub Actions workflow changes in your own fork before opening a PR to apache/pulsar. Please check the comments in #15385 (comment) . |
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ManagedLedgerCompressionTest.java
Outdated
Show resolved
Hide resolved
...ntegration/src/test/java/org/apache/pulsar/tests/integration/io/sinks/KinesisSinkTester.java
Outdated
Show resolved
Hide resolved
...ntegration/src/test/java/org/apache/pulsar/tests/integration/io/sinks/KinesisSinkTester.java
Outdated
Show resolved
Hide resolved
I don't think that it's a good goal to complete all changes for PIP-156 in a single PR. Smaller PRs are easier to review and get merged. For example, there's no sense in putting the Kinesis related changes in this PR. That should be solved separately. |
Hi @lhotari @nicoloboschi, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
…e required checks - PR apache#15264 makes changes to the build jobs and it's necessary to drop the required checks `CI - Unit - Brokers - JDK 8` and `CI - Integration - Shade` before the PR can be merged`
@heesung-sn The changes to .asf.yaml will have to be handled separately. To prevent issues where currently in-progress PRs get blocked by the new required checks ( #15496 is needed as a preparation for allowing to merge this current PR. That removes the existing required checks |
@heesung-sn Are you interested in a follow up PR to address the above comment? |
I already created #15505 to address this. |
Why are we requiring JDK17 to build ? I agree that we can ensure that Pulsar works well on JDK17 and that we should run CI on JDK17. can we REQUIRE JDK11 instead of JDK17 ? |
Initially, the motivation for this was to enable the use of new language features in Pulsar server-side modules, for example, using the Java record types.
I doubt that it's a problem for Pulsar broker. You must run Pulsar on a recent JDK version in any case, and requiring Java 17 makes sense for the broker. Pulsar client and Pulsar admin client libraries will continue to support Java 8. For some reason, PIP-156 was specified in a way that Pulsar CLI tools also require Java 17 to run. @heesung-sn Can you explain why Java 17 is required for Pulsar CLI tools?
That's possible, but I don't think that there's a specific reason to stop at JDK11 now that JDK17 is the current Java LTS release. |
Hi, after rebasing to master that includes this PR, I could not build JDK 11: sdk use java 11.0.2-open
mvn clean install -DskipTests -pl pulsar-client -am
JDK 8: sdk use java 8.332.08.1-amzn
mvn clean install -DskipTests -pl pulsar-client -am
Could you help take a look? @heesung-sn @lhotari |
I've also tried the patch of #15505 with JDK 8. It failed with
|
@BewareMyPower the goal is to have a pulsar-client jar that is compatible with Java 8, though not necessarily have the build system to work with Java 8 |
I see this followup change. Thank you for taking care of this. |
As discussed in the pip-156, #15207, the goal of this upgrade is to enable pulsar to adapt new java features. Regarding CLI java version, because CLI has dependencies on broker modules, it needs to follow broker's java version. |
@heesung-sn Why does the CLI depend on broker modules? Would it be possible to break these dependencies so that the CLI could run on older Java versions? |
I see that many CLI commands directly call broker logics, acting as a "kind-of" broker. For example, pulsar/pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorTool.java Lines 33 to 46 in 6d9ba7b
Specifically, this pulsar/pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactorTool.java Lines 151 to 156 in 6d9ba7b
I think it is possible to break these dependencies, but this requires some serious work. For example, we need to redesign CLI as a pure request/wait client, and there should be a backend async executor service on broker(or on a separate server) that runs the actual CLI logics. |
In my opinion such tools that use Broker internals are very version specific and they are usually executed from the same package (and machines?) of the broker (I would never use the Compator tool of a older version or from a newer version for instance) |
Note that the compactor tool is accessible via the script named |
Made a PR for copying the instruction to the contribution page, #15535 |
Fixed one module: #19991 |
Master Issue: #15207
Motivation
This is to upgrade Pulsar Server's Java build version to 17.
The detail motivation is described in the PIP-156, #15207
There will be multiple commits under this PR to complete the tasks under PIP-156.
Modifications
This changes Pulsar Server modules' javac release version to 17 except client (shared) modules
The detail modification is described in the PIP-156, #15207
Verifying this change
(Please pick either of the following options)
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below or label this PR directly.
Need to update docs?
doc-required
(Your PR needs to update docs and you will update later)
no-need-doc
(Please explain why)
doc
(Your PR contains doc changes)
doc-added
(Docs have been already added)