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

[test] Java 17 upgrade w/ Java 8 bytecode #23803

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

ZacBlanco
Copy link
Contributor

Description

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* ... :pr:`12345`
* ... :pr:`12345`

Hive Connector Changes
* ... :pr:`12345`
* ... :pr:`12345`

If release note is NOT required, use:

== NO RELEASE NOTE ==

@ZacBlanco ZacBlanco force-pushed the upgradeJava17 branch 5 times, most recently from a8d965a to 227f154 Compare October 11, 2024 04:01
@aaneja
Copy link
Contributor

aaneja commented Oct 11, 2024

Collating the test failures I see so far -

  1. test (:presto-cassandra -P test-cassandra-integration-smoke-test) :
java.lang.ExceptionInInitializerError
	at org.apache.cassandra.db.DataTracker.init(DataTracker.java:381)
	at org.apache.cassandra.db.DataTracker.<init>(DataTracker.java:60)
	at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:368)
	at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:527)
	at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:498)
	at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:335)
	at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:275)
	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:121)
	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:98)
	at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:584)
	at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:292)
	at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:566)
	at com.facebook.presto.cassandra.EmbeddedCassandra.start(EmbeddedCassandra.java:78)
	at com.facebook.presto.cassandra.CassandraQueryRunner.createCassandraQueryRunner(CassandraQueryRunner.java:40)
	at com.facebook.presto.cassandra.TestCassandraIntegrationSmokeTest.createQueryRunner(TestCassandraIntegrationSmokeTest.java:97)
	at com.facebook.presto.tests.AbstractTestQueryFramework.init(AbstractTestQueryFramework.java:85)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:65)
	at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:381)
	at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:319)
	at org.testng.internal.invokers.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
	at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:122)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field final java.util.Comparator java.util.concurrent.ConcurrentSkipListMap.comparator accessible: module java.base does not "opens java.util.concurrent" to unnamed module @47db50c5
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:[172](https://github.com/prestodb/presto/actions/runs/11286083182/job/31389877608?pr=23803#step:7:173))
	at org.github.jamm.MemoryMeter.addFieldChildren(MemoryMeter.java:294)
	at org.github.jamm.MemoryMeter.measureDeep(MemoryMeter.java:234)
	at org.apache.cassandra.utils.ObjectSizes.measureDeep(ObjectSizes.java:153)
	at org.apache.cassandra.db.Memtable.estimateRowOverhead(Memtable.java:433)
	at org.apache.cassandra.db.Memtable.<clinit>(Memtable.java:55)```
  1. test (:presto-hive -P test-hive-pushdown-filter-queries-basic) -
Error:  com.facebook.presto.hive.TestHivePushdownIntegrationSmokeTest.init  Time elapsed: 3.277 s  <<< FAILURE!
java.lang.NoClassDefFoundError: Could not initialize class com.facebook.presto.hive.HdfsEnvironment
	at com.facebook.presto.hive.HiveQueryRunner.getFileHiveMetastore(HiveQueryRunner.java:312)
	at com.facebook.presto.hive.HiveQueryRunner.createQueryRunner(HiveQueryRunner.java:221)
	at com.facebook.presto.hive.HiveQueryRunner.createQueryRunner(HiveQueryRunner.java:162)
	at com.facebook.presto.hive.HiveQueryRunner.createQueryRunner(HiveQueryRunner.java:146)
	at com.facebook.presto.hive.HiveQueryRunner.createQueryRunner(HiveQueryRunner.java:131)
	at com.facebook.presto.hive.TestHivePushdownIntegrationSmokeTest.createQueryRunner(TestHivePushdownIntegrationSmokeTest.java:48)
	at com.facebook.presto.tests.AbstractTestQueryFramework.init(AbstractTestQueryFramework.java:85)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:65)
	at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:381)
	at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:319)
	at org.testng.internal.invokers.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
	at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:122)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.reflect.InaccessibleObjectException: Unable to make private native java.lang.reflect.Field[] java.lang.Class.getDeclaredFields0(boolean) accessible: module java.base does not "opens java.lang" to unnamed module @6926f358 [in thread "TestNG-test=Surefire test-1"]
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:[200](https://github.com/prestodb/presto/actions/runs/11286083182/job/31389878203?pr=23803#step:7:201))
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:194)
	at org.apache.hadoop.fs.HadoopExtendedFileSystemCache.getModifiersField(HadoopExtendedFileSystemCache.java:60)
	at org.apache.hadoop.fs.HadoopExtendedFileSystemCache.setFinalStatic(HadoopExtendedFileSystemCache.java:39)
	at org.apache.hadoop.fs.HadoopExtendedFileSystemCache.initialize(HadoopExtendedFileSystemCache.java:29)
  1. test (:presto-main) -
Error:  Tests run: 8536, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 1,073.745 s <<< FAILURE! - in TestSuite
Error:  com.facebook.presto.operator.aggregation.TestKllSketchStateSerializer.testEstimatedMemorySizeString  Time elapsed: 0.006 s  <<< FAILURE!
java.lang.AssertionError: estimated memory size error for sketch stream size 512 was > 5%: 0.22 expected [true] but found [false]
	at org.testng.Assert.fail(Assert.java:110)
	at org.testng.Assert.failNotEquals(Assert.java:1413)
	at org.testng.Assert.assertTrue(Assert.java:56)
	at com.facebook.presto.operator.aggregation.TestKllSketchStateSerializer.testEstimatedMemorySize(TestKllSketchStateSerializer.java:119)

@ZacBlanco
Copy link
Contributor Author

ZacBlanco commented Oct 11, 2024

I looked into presto-accumulo as well as ci / product-tests-specific-environment2


presto-accumulo

This one failed because the minicluster dependency hard-codes the usage of the CMS GC which was removed from in JDK14. The earliest accumulo release without the CMS in minicluster is 2.1.0. Latest patch is 2.1.3. I attempted an upgrade but there are a ton of dependency conflicts I didn't feel like diving into yet...


product-tests-specific-environment2

This one failed because it looks like SecondsSinceEpochJsonFieldDecoder used a method inside of java's Math#multiplyExact which was refactored in a later JDK to only have argument of (long, long) but it looks like a (long, int) is supplied. Though IntelliJ doesn't seem to complain which is odd. Either way, appending L to the end of the int literal to make a long literal did the trick on my local machine. I will push that change soon.


tests-other-modules

Seems mostly add-opens issues. Needs:

  1. java.base/java.io
  2. java.base/jdk.internal.loader
  3. java.base/java.security
  4. java.base/java.util.concurrent
  5. java.base/javax.security.auth.login
  6. java.base/javax.security.auth
  7. java.base/java.lang.ref
  8. java.base/java.io
  9. java.base/java.nio
  10. java.base/java.util.regex
    edit: I added the missing set in 8305f3d

@imjalpreet
Copy link
Member

imjalpreet commented Oct 14, 2024

product-tests-specific-environment2
This one failed because it looks like SecondsSinceEpochJsonFieldDecoder used a method inside of java's Math#multiplyExact which was refactored in a later JDK to only have argument of (long, long) but it looks like a (long, int) is supplied. Though IntelliJ doesn't seem to complain which is odd. Either way, appending L to the end of the int literal to make a long literal did the trick on my local machine. I will push that change soon.

product-tests-specific-environment2

I believe these failures happen since we are building with Java 17 but using Java 8 at runtime in the docker images. These issues should likely be fixed once the docker images are updated to use Java 17.

We should also look into enhancing Tempto to be able to use multiple Java versions so that we can run our CI pipeline with both Java 8 and Java 17+ and pass an argument to be able to choose which Java version to use while starting the Presto server in the docker images.

@imjalpreet
Copy link
Member

imjalpreet commented Oct 14, 2024

test-other-modules

Apart from the add-opens issues, I see issues while trying to connect to the zookeeper client in presto-kafka due to which none of the tests ran. Most likely the version is not compatible with Java 17.

2024-10-10T22:25:26.753-0600 INFO [ZooKeeperClient Kafka server] Closing.
2024-10-11T04:25:26.9311074Z 2024-10-10T22:25:26.852-0600 WARNING Session 0x0 for server 127.0.0.1/<unresolved>:43305, unexpected error, closing socket connection and attempting reconnect
2024-10-11T04:25:26.9312510Z java.lang.IllegalArgumentException: Unable to canonicalize address 127.0.0.1/<unresolved>:43305 because it's not resolvable

@imjalpreet
Copy link
Member

test (:presto-spark-base -P presto-spark-tests-smoke)

Current failures are all related to add-opens issues. But many tests were skipped due to these, we will have a better idea once we fix them.

test (:presto-spark-base -P presto-spark-tests-all-queries)

Current failures are all related to add-opens issues. But all tests were skipped due to these, we will have a better idea once we fix them.

test / test (:presto-spark-base -P presto-spark-tests-spill-queries)

Current failures are all related to add-opens issues. But all tests were skipped due to these, we will have a better idea once we fix them.

@ZacBlanco ZacBlanco force-pushed the upgradeJava17 branch 2 times, most recently from 6b1917b to e6b7f1d Compare October 15, 2024 16:20
Copy link

linux-foundation-easycla bot commented Oct 21, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@aaneja aaneja force-pushed the upgradeJava17 branch 3 times, most recently from 3893f06 to 72da587 Compare October 22, 2024 09:49
@ZacBlanco ZacBlanco changed the title [test] java upgrade [test] java 17 upgrade Nov 5, 2024
@aaneja aaneja changed the title [test] java 17 upgrade [test] Java 17 upgrade w/ Java 8 bytecode Nov 26, 2024
imjalpreet and others added 11 commits November 26, 2024 20:59
There are a large number of parameters passed to argLine
through the airbase POM. Set the airbase-specific props
instead to aid in test failures
It seems later JVMs have drasitically improved their String
representations. However, the string test is a bit of a wash
because the estimated size entirely depends upon the
strings which are used as input to the sketch. I think it's
ok for this test to not be accurate for string-typed
arguments for now.
For future, we can leave this as the default (true), but for
testing on the PR we want to see both actions run
ZacBlanco and others added 2 commits December 5, 2024 12:28
- Uses new image 'aaneja/hdp2.6-hive-kerberized-jdk17' that is the base `hdp2.6-hive-kerberized` with JDK 17 added to `/opt/java`
- presto-launcher-wrapper.sh was updated to use Java from `/opt/java` if present
- New add-opens for Keberos classes
- multinode-tls-kerberos updated to use `aaneja/hdp2.6-hive-kerberized-jdk17`

- singlenode-ldap updated to use new image `aaneja/centos6-oj8-openldap-jdk17`

- product-tests-specific-environment2 updated to only run on JDK 17 for now
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.

3 participants