Skip to content

Conversation

@xiangfu0
Copy link
Contributor

@xiangfu0 xiangfu0 commented Feb 28, 2022

Description

The goal here is to free pinot modules from JDK 8 binding for releases.

The problem of Pinot is still partially depends on JDK 8 is due to PrestoDB project still on JDK8 and PrestoDB requiring all transitive dependencies compilable with JDK8.

Solution:

  1. Create JDK8 modules for pinot-spi, pinot-segment-spi, pinot-segment-local, pinot-common, pinot-core and use symlink for src directory
  2. Have the same profile presto-driver to build the above jars in JDK8
  3. Make presto-pinot-driver only depends on those jdk8 modules and built with the profile flag.
  4. All other pinot modules can be built and released with a higher JDK version.

How to build:

mvn clean install -DskipTests -Ppresto-driver  -T 16

Note(My hope as well):
Once PrestoDB upgraded JDK, we can retire those jdk8 modules.

Upgrade Notes

Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)

  • Yes (Please label as backward-incompat, and complete the section below on Release Notes)

Does this PR fix a zero-downtime upgrade introduced earlier?

  • Yes (Please label this as backward-incompat, and complete the section below on Release Notes)

Does this PR otherwise need attention when creating release notes? Things to consider:

  • New configuration options
  • Deprecation of configurations
  • Signature changes to public methods/interfaces
  • New plugins added or old plugins removed
  • Yes (Please label this PR as release-notes and complete the section on Release Notes)

Release Notes

Documentation

@xiangfu0 xiangfu0 force-pushed the pinot-jdk8-modules branch 3 times, most recently from ece9801 to d2c7fd5 Compare February 28, 2022 23:31
Copy link
Member

Choose a reason for hiding this comment

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

🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The final goal is to remove the JDK8 build profile and move that to the presto dependency side :p

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the source code are the same, do we need to add these new modules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, Presto side will pull and compile the dependencies transitively, and those jars have to be JDK 8 binary code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this still require code to be java 8 compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here are some leftover works once folks(e.g. Uber) upgrade their build system from JDK 8. We can completely change the profile of the JDK8 build and call that Pinot deprecated JDK 8 build but can be released with JDK 8 binary.

@xiangfu0 xiangfu0 force-pushed the pinot-jdk8-modules branch from e901c08 to 34e52b9 Compare March 1, 2022 17:22
@xiangfu0 xiangfu0 requested a review from Jackie-Jiang March 1, 2022 17:24
@xiangfu0 xiangfu0 force-pushed the pinot-jdk8-modules branch from 8d604c9 to 57a63fa Compare March 1, 2022 17:46
@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2022

Codecov Report

Merging #8266 (359b13a) into master (d999aec) will decrease coverage by 6.72%.
The diff coverage is 55.27%.

❗ Current head 359b13a differs from pull request most recent head 57a63fa. Consider uploading reports for the commit 57a63fa to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #8266      +/-   ##
============================================
- Coverage     70.78%   64.05%   -6.73%     
+ Complexity     4243     4240       -3     
============================================
  Files          1631     1586      -45     
  Lines         85281    83567    -1714     
  Branches      12845    12674     -171     
============================================
- Hits          60364    53532    -6832     
- Misses        20746    26173    +5427     
+ Partials       4171     3862     -309     
Flag Coverage Δ
integration1 ?
integration2 ?
unittests1 66.92% <33.58%> (-0.07%) ⬇️
unittests2 14.20% <39.27%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
...g/apache/pinot/common/utils/helix/HelixHelper.java 13.46% <0.00%> (-32.65%) ⬇️
...ache/pinot/common/metadata/ZKMetadataProvider.java 17.44% <17.14%> (-61.69%) ⬇️
...er/api/resources/PinotInstanceRestletResource.java 51.48% <50.00%> (-12.72%) ⬇️
...predicate/RegexpLikePredicateEvaluatorFactory.java 27.27% <50.00%> (ø)
...izer/statement/StringPredicateFilterOptimizer.java 84.31% <60.00%> (-7.80%) ⬇️
...e/pinot/broker/broker/helix/BaseBrokerStarter.java 72.58% <77.77%> (-3.09%) ⬇️
...ntroller/helix/core/PinotHelixResourceManager.java 63.31% <82.55%> (-2.76%) ⬇️
...request/context/predicate/RegexpLikePredicate.java 73.68% <100.00%> (+7.01%) ⬆️
.../controller/helix/ControllerRequestURLBuilder.java 74.41% <100.00%> (-9.05%) ⬇️
...a/org/apache/pinot/core/common/DataBlockCache.java 88.65% <100.00%> (-2.78%) ⬇️
... and 388 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d999aec...57a63fa. Read the comment docs.

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

LGTM.
It would be good if we can extract the common dependencies for jdk11 and jdk8 pom file so that we don't need to manually keep them in-sync

Copy link
Member

@jackjlli jackjlli left a comment

Choose a reason for hiding this comment

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

Currently Pinot at LinkedIn is partly on jdk 8, mainly on the offline ingestion part (very similar to the situation of Presto). And bumping up jdk version to 11 in the offline world is non-trivial since there are a lot dependencies/components that need to be Java 11 compatible (e.g. Hadoop 3.0+ needs to be used, etc).
I also tried out the Pinot Java 11 compiled code in current offline env but since Java 8 is being used there, there is no way to run the Pinot Java 11 compiled code there (it's not allowed to run code compiled in higher jdk version in a lower jvm version).
What's the plan for these jdk8 modules? Will they be left in Presto? If that's the case, we may also need some extra modules to be jdk 8 compatible.

<phase.prop>package</phase.prop>
</properties>

<profiles>
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any new module for these pluggable modules. Will they come in the following PRs or is there any other plan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no plan, we just don't have to release those modules in jdk8 really.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

presto-pinot-driver has transitive test dependencies on those jars, so we actually don't need to release those jars with JDK 8.

Copy link
Member

Choose a reason for hiding this comment

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

But we do have some code which is maintained by Pinot only. E.g. in pinot-avro-base module, we have AvroRecordReader which is only for Pinot. How do we deal with this code?

Copy link
Contributor Author

@xiangfu0 xiangfu0 Mar 1, 2022

Choose a reason for hiding this comment

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

right, so for any dependencies that presto is depending on, we need to make those have a jdk8 version.
For module like pinot-avro-base, it's not required the compile dependencies of presto-pinot-driver but only test dependency for pinot-core, so this time I don't include them.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we do have some code which is maintained by Pinot only. E.g. in pinot-avro-base module, we have AvroRecordReader which is only for Pinot. How do we deal with this code?

We don't need to do anything with this code.

@xiangfu0
Copy link
Contributor Author

xiangfu0 commented Mar 1, 2022

Currently Pinot at LinkedIn is partly on jdk 8, mainly on the offline ingestion part (very similar to the situation of Presto). And bumping up jdk version to 11 in the offline world is non-trivial since there are a lot dependencies/components that need to be Java 11 compatible (e.g. Hadoop 3.0+ needs to be used, etc). I also tried out the Pinot Java 11 compiled code in current offline env but since Java 8 is being used there, there is no way to run the Pinot Java 11 compiled code there (it's not allowed to run code compiled in higher jdk version in a lower jvm version). What's the plan for these jdk8 modules? Will they be left in Presto? If that's the case, we may also need some extra modules to be jdk 8 compatible.

For LinkedIn internal, you can always use the parameter to build JDK 8 binary code jars and publish them to internal artifactory. This change impacts maven that's why we have to separate the modules.

@jackjlli
Copy link
Member

jackjlli commented Mar 1, 2022

Currently Pinot at LinkedIn is partly on jdk 8, mainly on the offline ingestion part (very similar to the situation of Presto). And bumping up jdk version to 11 in the offline world is non-trivial since there are a lot dependencies/components that need to be Java 11 compatible (e.g. Hadoop 3.0+ needs to be used, etc). I also tried out the Pinot Java 11 compiled code in current offline env but since Java 8 is being used there, there is no way to run the Pinot Java 11 compiled code there (it's not allowed to run code compiled in higher jdk version in a lower jvm version). What's the plan for these jdk8 modules? Will they be left in Presto? If that's the case, we may also need some extra modules to be jdk 8 compatible.

For LinkedIn internal, you can always use the parameter to build JDK 8 binary code jars and publish them to internal artifactory. This change impacts maven that's why we have to separate the modules.

Yes I understand the purpose of this PR, but what'd be the next steps? After splitting out to the separate modules, will the existing modules like pinot-core or pinot-common still be jdk 8 compatible? Will they be able to compile with parameters like -Djdk.version=8?
Also, how about those pluggable modules like pinot-avro? Do they need to copy over to a jdk 8 compatible modules?

@xiangfu0
Copy link
Contributor Author

xiangfu0 commented Mar 1, 2022

Currently Pinot at LinkedIn is partly on jdk 8, mainly on the offline ingestion part (very similar to the situation of Presto). And bumping up jdk version to 11 in the offline world is non-trivial since there are a lot dependencies/components that need to be Java 11 compatible (e.g. Hadoop 3.0+ needs to be used, etc). I also tried out the Pinot Java 11 compiled code in current offline env but since Java 8 is being used there, there is no way to run the Pinot Java 11 compiled code there (it's not allowed to run code compiled in higher jdk version in a lower jvm version). What's the plan for these jdk8 modules? Will they be left in Presto? If that's the case, we may also need some extra modules to be jdk 8 compatible.

For LinkedIn internal, you can always use the parameter to build JDK 8 binary code jars and publish them to internal artifactory. This change impacts maven that's why we have to separate the modules.

Yes I understand the purpose of this PR, but what'd be the next steps? After splitting out to the separate modules, will the existing modules like pinot-core or pinot-common still be jdk 8 compatible? Will they be able to compile with parameters like -Djdk.version=8?

So there are two ways to generate JDK 8 binary:

  1. Build the project with JDK8 and -Djdk.version=8
  2. Build the project with JDK11+ and -Djdk.version=8

For 1, you need to make sure the source code is JDK 8 compatible
For 2, you don't have to.

@xiangfu0
Copy link
Contributor Author

xiangfu0 commented Mar 1, 2022

Currently Pinot at LinkedIn is partly on jdk 8, mainly on the offline ingestion part (very similar to the situation of Presto). And bumping up jdk version to 11 in the offline world is non-trivial since there are a lot dependencies/components that need to be Java 11 compatible (e.g. Hadoop 3.0+ needs to be used, etc). I also tried out the Pinot Java 11 compiled code in current offline env but since Java 8 is being used there, there is no way to run the Pinot Java 11 compiled code there (it's not allowed to run code compiled in higher jdk version in a lower jvm version). What's the plan for these jdk8 modules? Will they be left in Presto? If that's the case, we may also need some extra modules to be jdk 8 compatible.

For LinkedIn internal, you can always use the parameter to build JDK 8 binary code jars and publish them to internal artifactory. This change impacts maven that's why we have to separate the modules.

Yes I understand the purpose of this PR, but what'd be the next steps? After splitting out to the separate modules, will the existing modules like pinot-core or pinot-common still be jdk 8 compatible? Will they be able to compile with parameters like -Djdk.version=8? Also, how about those pluggable modules like pinot-avro? Do they need to copy over to a jdk 8 compatible modules?

For pinot-avro etc, so far I don't find the need for moving to publish jdk8 jars.

@xiangfu0 xiangfu0 merged commit 1c4512e into apache:master Mar 1, 2022
@xiangfu0 xiangfu0 deleted the pinot-jdk8-modules branch March 1, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants