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

[patch][pulsar-sql] Add Java version trim agent for presto 332 #15236

Merged

Conversation

gaoran10
Copy link
Contributor

@gaoran10 gaoran10 commented Apr 20, 2022

Fix #14951

Motivation

The presto 332 couldn't parse Java version like this 11.0.14.1, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Modifications

Add a Java version trim agent to format the system property java.version for the Pulsar SQL plugin.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (yes)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

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)

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Apr 20, 2022
@gaoran10 gaoran10 added the area/sql Pulsar SQL related features label Apr 20, 2022
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

Good work! A few minor changes

@lhotari
Copy link
Member

lhotari commented Apr 21, 2022

@gaoran10 Please reply to my review comments.

@gaoran10 gaoran10 force-pushed the java-version-trim-agent-presto332 branch from 80e22d4 to 86f12c6 Compare April 21, 2022 09:34
@gaoran10
Copy link
Contributor Author

@lhotari Thanks for your suggestions, and address comments. PTAL

Comment on lines 60 to 61
envMap.put("managedLedgerMaxEntriesPerLedger", String.valueOf(ENTRIES_PER_LEDGER));
envMap.put("managedLedgerMinLedgerRolloverTimeMinutes", "0");
Copy link
Member

Choose a reason for hiding this comment

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

these settings might be needed for other tests, not just PulsarSQL offloading tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These configurations are only needed by the test TestPrestoQueryTieredStorage.java, they are used to control offload operation. The TestBasicPresto.java don't need them.

Copy link
Member

Choose a reason for hiding this comment

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

Please take care of that in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, fixed

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

Why are you making changes to TestPrestoQueryTieredStorage.java and PulsarSQLTestSuite.java as part of this PR? I think those changes should be reverted.

…undError: org/apache/pulsar/shade/javax/annotation/Priority.

```
Caused by: java.lang.NoClassDefFoundError: org/apache/pulsar/shade/javax/annotation/Priority
at org.apache.pulsar.shade.org.glassfish.jersey.model.internal.CommonConfig$FeatureRegistration.priority(CommonCon {}
at org.apache.pulsar.shade.org.glassfish.jersey.model.internal.CommonConfig$FeatureRegistration.<init>(CommonConfig.java:119)
at org.apache.pulsar.shade.org.glassfish.jersey.model.internal.CommonConfig$FeatureRegistration.<init>(CommonConfig.java:107)
at org.apache.pulsar.shade.org.glassfish.jersey.model.internal.CommonConfig.processFeatureRegistration(CommonConfig.java:511)
at org.apache.pulsar.shade.org.glassfish.jersey.model.internal.CommonConfig.register(CommonConfig.java:418)
at org.apache.pulsar.shade.org.glassfish.jersey.client.ClientConfig$State.register(ClientConfig.java:216)
at org.apache.pulsar.shade.org.glassfish.jersey.client.ClientConfig.register(ClientConfig.java:606)
at org.apache.pulsar.client.admin.internal.PulsarAdminImpl.<init>(PulsarAdminImpl.java:179)
at org.apache.pulsar.client.admin.internal.PulsarAdminBuilderImpl.build(PulsarAdminBuilderImpl.java:47)
at org.apache.pulsar.sql.presto.PulsarConnectorConfig.getPulsarAdmin(PulsarConnectorConfig.java:474)
... 51 more {}
Caused by: java.lang.ClassNotFoundException: org.apache.pulsar.shade.javax.annotation.Priority
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
at io.prestosql.server.PluginClassLoader.loadClass(PluginClassLoader.java:89)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 61 more
```
@gaoran10
Copy link
Contributor Author

@codelipenghui @lhotari All comments are resolved. PTAL, thanks

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

Good work!

@codelipenghui codelipenghui merged commit a1aa18f into apache:master Apr 24, 2022
@codelipenghui codelipenghui added this to the 2.11.0 milestone Apr 24, 2022
@gaoran10 gaoran10 deleted the java-version-trim-agent-presto332 branch April 24, 2022 06:10
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request Apr 26, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Apr 26, 2022
@codelipenghui
Copy link
Contributor

@gaoran10 I'm not able to cherry-pick this one to branch-2.10, could you please help with this or push a PR to branch-2.10 directly.

@codelipenghui
Copy link
Contributor

421e7c7 for cherry-picking to branch-2.9

gaoran10 added a commit to gaoran10/pulsar that referenced this pull request Apr 28, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request Apr 28, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
merlimat pushed a commit that referenced this pull request Apr 28, 2022
…#15373)

* [patch][pulsar-sql] Add Java version trim agent for presto 332 (#15236)

Fix #14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)

* fix presto License check and version
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request May 10, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
@gaoran10 gaoran10 restored the java-version-trim-agent-presto332 branch May 10, 2022 04:12
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request May 10, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request May 11, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request May 11, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request May 11, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request May 11, 2022
…e#15236)

Fix apache#14951

The presto 332 couldn't parse Java version like this `11.0.14.1`, so add a Java version trim agent to walk around the problem.

This is a temporary patch, after the presto upgrade to 332+, we could remove this.

Add a Java version trim agent to format the system property `java.version` for the Pulsar SQL plugin.

(cherry picked from commit a1aa18f)
@codelipenghui
Copy link
Contributor

#15371 cherrypick to branch-2.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql Pulsar SQL related features cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 doc-not-needed Your PR changes do not impact docs release/2.9.3 release/2.10.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pulsar SQL won't start with Java 11.0.14.1
3 participants