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

Bump antlr4 from 4.9.3 to 4.11.1 #4546

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Conversation

reta
Copy link
Collaborator

@reta reta commented Sep 19, 2022

Signed-off-by: Andriy Redko [email protected]

Description

Manually bumping antlr4 version and regenerate parsers

Issues Resolved

Closes #4412 and #4412

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@reta reta requested a review from a team as a code owner September 19, 2022 13:09
@reta reta added the backport 2.x Backport to 2.x branch label Sep 19, 2022
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator Author

reta commented Sep 19, 2022

Ah, bad news, the Apache Lucene still uses some Antlr 3.x bits (serialized ATN, see here [1] please), but the compatibility with Antlr 3.x was removed [2] recently. As such, Apache Lucene is not compatible with Antlr 4.10+ :(

[1] https:/apache/lucene/blob/main/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java#L189
[2] antlr/antlr4@c68e127

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2022

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator Author

reta commented Dec 16, 2022

Getting there :) apache/lucene#11788 is merged, 🤞 it will be backported to 9.5

@@ -1,5 +1,5 @@
opensearch = 3.0.0
lucene = 9.5.0-snapshot-d5cef1c
lucene = 9.5.0-snapshot-6700b7e
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The latest snapshots are needed to bring apache/lucene#12016 in

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #4546 (e5fdf9d) into main (cb26035) will decrease coverage by 0.04%.
The diff coverage is 10.52%.

@@             Coverage Diff              @@
##               main    #4546      +/-   ##
============================================
- Coverage     70.95%   70.91%   -0.05%     
+ Complexity    58304    58296       -8     
============================================
  Files          4733     4733              
  Lines        278256   278256              
  Branches      40249    40249              
============================================
- Hits         197441   197319     -122     
- Misses        64628    64771     +143     
+ Partials      16187    16166      -21     
Impacted Files Coverage Δ
...arch/painless/antlr/PainlessParserBaseVisitor.java 1.26% <ø> (ø)
.../org/opensearch/painless/antlr/PainlessParser.java 68.43% <5.55%> (ø)
...a/org/opensearch/painless/antlr/PainlessLexer.java 68.18% <100.00%> (ø)
...adonly/AddIndexBlockClusterStateUpdateRequest.java 0.00% <0.00%> (-75.00%) ⬇️
...readonly/TransportVerifyShardIndexBlockAction.java 9.75% <0.00%> (-73.18%) ⬇️
.../index/shard/IndexShardNotRecoveringException.java 0.00% <0.00%> (-50.00%) ⬇️
.../opensearch/test/store/MockFSDirectoryFactory.java 22.66% <0.00%> (-46.67%) ⬇️
...rch/client/transport/NoNodeAvailableException.java 28.57% <0.00%> (-42.86%) ⬇️
...h/action/ingest/SimulateDocumentVerboseResult.java 60.71% <0.00%> (-39.29%) ⬇️
...indices/readonly/TransportAddIndexBlockAction.java 20.68% <0.00%> (-37.94%) ⬇️
... and 476 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@reta
Copy link
Collaborator Author

reta commented Dec 16, 2022

@dblock @nknize I think we are good to go! (no backport since hard dependency on Apache Lucene 9.5), thanks guys!

@dblock dblock merged commit 306b199 into opensearch-project:main Dec 19, 2022
@acarbonetto
Copy link
Contributor

I know this is merged, but it seems to be causing fatal errors on the darwin-arm64-tar builds when running on m1 macs.

» ERROR][o.o.b.OpenSearchUncaughtExceptionHandler] [runTask-0] fatal error in thread [main], exiting
»  java.lang.NoClassDefFoundError: org/opensearch/index/rankeval/RankEvalAction
»       at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:?]
»       at java.lang.Class.privateGetDeclaredConstructors(Class.java:3373) ~[?:?]
»       at java.lang.Class.getConstructors(Class.java:2060) ~[?:?]
»       at org.opensearch.plugins.PluginsService.loadPlugin(PluginsService.java:765) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.plugins.PluginsService.loadBundle(PluginsService.java:731) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.plugins.PluginsService.loadBundles(PluginsService.java:533) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.plugins.PluginsService.<init>(PluginsService.java:195) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.node.Node.<init>(Node.java:427) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.node.Node.<init>(Node.java:354) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:242) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:404) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:180) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:171) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138) ~[opensearch-cli-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.cli.Command.main(Command.java:101) ~[opensearch-cli-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:137) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»       at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:103) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  Caused by: java.lang.ClassNotFoundException: org.opensearch.index.rankeval.RankEvalAction
»       at java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
»       at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
»       at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:872) ~[?:?]
»       at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
»       ... 19 more

When I checkout the commit prior git checkout ff43d768b10f97bac35a2638c2c6bc2b642cd10f then my ./gradlew run runs fine.

@reta
Copy link
Collaborator Author

reta commented Dec 22, 2022

When I checkout the commit prior git checkout ff43d768b10f97bac35a2638c2c6bc2b642cd10f then my ./gradlew run runs fine.

I have difficulties understanding how this specific change impacts rank-eval plugin (especially on M1), @acarbonetto do you build the complete distribution locally?

@acarbonetto
Copy link
Contributor

I don't understand it either. I've been trying to work through the changes and I don't see the relevance.

do you build the complete distribution locally?

Yes. I'm using :distribution:archives:darwin-arm64-tar:assemble and :distribution:archives:darwin-arm64-tar:build to build the install and running it from ./distribution/archives/darwin-arm64-tar/build/install/opensearch-3.0.0-SNAPSHOT/bin/opensearch

@acarbonetto
Copy link
Contributor

Workaround is to work with Java 11.

If I build with Java 17 I get the above error, but not with Java 11. Something is missing in java 17 on arm64. The intel Mac seem to compile and build fine.

@reta
Copy link
Collaborator Author

reta commented Dec 22, 2022

Workaround is to work with Java 11.

If I build with Java 17 I get the above error, but not with Java 11. Something is missing in java 17 on arm64. The intel Mac seem to compile and build fine.

Ah ... this is very interesting, I sadly don't have M1 at my disposal but I will try to troubleshoot the issue on first occasion. What JDK distribution you use on M1?

@acarbonetto
Copy link
Contributor

What JDK distribution you use on M1?

I'm using Corretto-17.0.3.6.1.

If I found out more information, I'll let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants