Skip to content
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

Specify Multi-Release property in manifest #12131

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

gortiz
Copy link
Contributor

@gortiz gortiz commented Dec 8, 2023

Tag: bugfix

This is a very simple PR that modifies Pinot to include the standard tag Multi-Release in the shaded manifest.

This tag is defined in JEP-238. When specified, Java runtime 9 and newer consider the jar as a multi-release jar. You can read the JEP to have more context, but the TL;DR is that multi release jars may include more than one .class file for each Java class. Each .class can be optionally be associated with a given Java version and the JVM will load the correct class depending on their version.

For example, for a given class X, the jar may include a standard X and a custom version of X to be used in Java 11. In this case when running with Java 8, 9 or 10, the standard X will be used but the runtime is Java 11 or higher, it will use the Java 11 version.

It is important to note that we do not provide custom classes for any runtime, but our dependencies do include them. Given that by default we distribute Pinot in a fat-jar, we need to enable Multi-Release in our uber-jar to inform Java that it should use the newest classes.

For example, Lucene or Roaring Bitmap provide their own classes and even we include them in our uber-jar, Java does not load them right now because the Manifest doesn't say so. In the case of Lucene that is a problem because the standard org.apache.lucene.store.MemorySegmentIndexInput class doesn't work in Java 21.

In order to try this PR I've just did the following:

  • execute mvn clean
  • execute mvn install package -DskipTests -Pbin-dist -Pbuild-shaded-jar -Djdk.version=11 -T1C (which is what Dockerbuild does)
  • unzip build/lib/pinot-all-1.1.0-SNAPSHOT-jar-with-dependencies.jar
  • verify that META-INF/MANIFES.MF contains Multi-Release: true
  • verify that META-INF/versions/... is not empty (this is not necessary given these classes were already there, but just to verify that).

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5b4e19a) 61.51% compared to head (f69b1c3) 61.51%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #12131   +/-   ##
=========================================
  Coverage     61.51%   61.51%           
  Complexity     1153     1153           
=========================================
  Files          2415     2415           
  Lines        131157   131157           
  Branches      20245    20245           
=========================================
+ Hits          80683    80687    +4     
- Misses        44575    44576    +1     
+ Partials       5899     5894    -5     
Flag Coverage Δ
custom-integration1 <0.01% <ø> (ø)
integration <0.01% <ø> (ø)
integration1 <0.01% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 61.47% <ø> (+26.70%) ⬆️
java-21 61.40% <ø> (+<0.01%) ⬆️
skip-bytebuffers-false 61.50% <ø> (+<0.01%) ⬆️
skip-bytebuffers-true 61.37% <ø> (-0.01%) ⬇️
temurin 61.51% <ø> (+<0.01%) ⬆️
unittests 61.51% <ø> (+<0.01%) ⬆️
unittests1 46.61% <ø> (+0.01%) ⬆️
unittests2 27.69% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jackie-Jiang Jackie-Jiang added bugfix dependencies Pull requests that update a dependency file labels Dec 12, 2023
@gortiz gortiz force-pushed the useMultiReleaseJar branch 2 times, most recently from 6df6276 to a31599c Compare December 18, 2023 11:46
@xiangfu0 xiangfu0 merged commit a0a9b6b into apache:master Jan 3, 2024
21 checks passed
@gortiz gortiz deleted the useMultiReleaseJar branch January 19, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants