-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[META] Set OpenSearch 3.0.0 baseline JDK version to JDK-21 #14011
Comments
@msfroh @andrross @dblock @getsaurabh02 fyi folks :) kicking off the campaign ... |
@reta Quick question on this. In response to this campaign, I updated our compatibility from JDK 11 to JDK 21 like this: java {
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
} Our normal development flow is to merge to I'm curious what the best approach here is. Can we keep Or if we're keeping both, it seems this style may be more broadly applicable and recommended here. Thoughts? tasks.withType(JavaCompile) {
options.release.set(21)
} |
@dbwiddis See some more discussion here: opensearch-project/custom-codecs#154 (comment) The risk is that some new language features will be exposed by a library using JDK21 as a baseline (i.e. Lucene) and that won't work smoothly if your source compatibility is lower than that. I'm not totally sure what those risks look like in practice though. |
Agreed that it's not clear what the risks are. I think there are other options (e.g., ForbiddenAPIs) for enforcing lower-JDK source standards, so I'll look into those to address the risk of "dang, my backport failed". And evaluate whether it's more effort to prevent it than to just fix it when it breaks... |
Thank you @dbwiddis , additionally to what @andrross said, I think the benefits of using new language features (as well as standard library) outweigh the inconvenience of manual backports (otherwise the legacy will always hold us back). Surely, there is also an option to use baseline constructs (JDK-11) without lowering the source compatibility levels.
I think this is sane approach, additionally we could also use something like https://github.com/openrewrite/rewrite (or similar) to "downgrade" source code during automatic backports. |
Please describe the end goal of this project
Currently, the 3.0.0 baseline JDK version is set to JDK-11. The Apache Lucene 10 is going to require JDK-21 and it would make sense to align the OpenSearch JDK baseline requirements with that.
In order to make the migration as painless as possible, the suggestion is to start from dependent components (plugins, clients, extensions, libraries) and finish up with core, for the following reasons:
Supporting References
Please see #10745
Issues
data-prepper
plugin 3.0.0 baseline JDK version to JDK-21 data-prepper#4605Related component
Build
The text was updated successfully, but these errors were encountered: