trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.37k stars 2.98k forks source link

[JDK 21] Build and run Trino on JDK 21 #17017

Closed wendigo closed 9 months ago

wendigo commented 1 year ago

Known problems:

wendigo commented 1 year ago

With the ./mvnw clean install -DskipTests -nsu -T 1C -U -Dair.check.skip-enforcer -Dair.check.skip-modernizer and:

I was able to compile Trino with JDK 21 as a target.

I'm gonna submit the PR to maven-dependency-plugin and maven-enforcer-plugin

wendigo commented 1 year ago

I've been able to compile and run Trino with mentioned changes on JDK 21:

❯ docker run trino:413-SNAPSHOT-arm64
+ launcher_opts=(--etc-dir /etc/trino)
+ grep -s -q node.id /etc/trino/node.properties
+ launcher_opts+=("-Dnode.id=${HOSTNAME}")
+ exec /usr/lib/trino/bin/launcher run --etc-dir /etc/trino -Dnode.id=f553225d9acc
WARNING: Support for the ARM architecture is experimental
# WARNING: Unable to attach Serviceability Agent. You can try again with escalated privileges. Two options: a) use -Djol.tryWithSudo=true to try with sudo; b) echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
Apr 13, 2023 10:41:20 AM io.airlift.log.Logger info
INFO: Java version: 21-ea

Querying TPCH works just fine :)

wendigo commented 1 year ago

https://github.com/apache/maven-dependency-analyzer was already upgraded to ASM 9.5 and released so I assume that it will soon land in maven-dependency-plugin

chenjian2664 commented 1 year ago

OMG, JDK21 is available 😱

wendigo commented 1 year ago

@chenjian2664 it's not ;) Targeted for September but we want to be prepared to switch to it

chenjian2664 commented 1 year ago

@wendigo So cool

wendigo commented 1 year ago

Related: https://github.com/trinodb/trino/pull/17044

wendigo commented 1 year ago

Related: https://github.com/trinodb/trino/pull/17484

wendigo commented 1 year ago

https://github.com/airlift/airbase/pull/359 fixes maven plugins compatibility

wendigo commented 1 year ago

I've just verified that error-prone HEAD works fine with JDK 21 after https://github.com/google/error-prone/pull/3918

wendigo commented 1 year ago

https://github.com/airlift/airbase/pull/359

wendigo commented 1 year ago

https://github.com/trinodb/trino/pull/17740

wendigo commented 1 year ago
diff --git a/pom.xml b/pom.xml
index 3e6fdb8d73..e01e285d30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,7 +60,7 @@
         <dep.drift.version>1.14</dep.drift.version>
         <dep.tempto.version>196</dep.tempto.version>
         <dep.gcs.version>2.2.8</dep.gcs.version>
-        <dep.errorprone.version>2.19.1</dep.errorprone.version>
+        <dep.errorprone.version>HEAD-SNAPSHOT</dep.errorprone.version>
         <dep.testcontainers.version>1.18.3</dep.testcontainers.version>
         <dep.duct-tape.version>1.0.8</dep.duct-tape.version>
         <dep.coral.version>2.0.153</dep.coral.version>
@@ -206,6 +206,19 @@
         <module>testing/trino-tests</module>
     </modules>

+    <repositories>
+        <repository>
+            <id>oss.sonatype.org-snapshot</id>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+
     <dependencyManagement>
         <dependencies>
             <!-- Trino -->
@@ -2074,6 +2087,7 @@
                                     <exclude>com.google.guava:guava</exclude>
                                     <exclude>com.fasterxml.jackson.core:jackson-core</exclude>
                                     <exclude>com.google.j2objc:j2objc-annotations</exclude>
+                                    <exclude>com.google.errorprone:error_prone_annotations</exclude>
                                 </excludes>
                             </requireUpperBoundDeps>
                             <bannedDependencies>

error-prone HEAD-SNAPSHOT is working with jdk 21

wendigo commented 1 year ago

https://github.com/trinodb/trino/pull/17770

wendigo commented 1 year ago

https://github.com/google/error-prone/releases/tag/v2.20.0

wendigo commented 1 year ago

https://github.com/trinodb/trino/pull/17941

wendigo commented 1 year ago

Blocked by https://github.com/trinodb/trino/issues/18272 (it's a regression starting with JDK 20)

wendigo commented 1 year ago

Requires https://github.com/trinodb/trino/pull/18931 (dropping HDP2.6 images which are based on Centos6 shipped with old glibc. This prevents installing Temurin JDK 21 and other builds)

mosabua commented 11 months ago

Trino 432 now uses Java 21 in the Trino Docker image.

mosabua commented 11 months ago

The 0.14.0 release of the Trino Helm charts https://github.com/trinodb/charts now uses Trino 432 and therefore Java 21.

mosabua commented 11 months ago

The blog post https://trino.io/blog/2023/11/03/java-21 announces our plans to require Java 21 and asks for feedback and testing reports.

mosabua commented 11 months ago

Announced on Trino slack and linkedin as well https://www.linkedin.com/feed/update/urn:li:activity:7126324119733686272