Skip to content

Commit

Permalink
Require JDK 22.0.0 to build and run Trino
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed May 1, 2024
1 parent e66aa29 commit d285be2
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 43 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
fail-fast: false
matrix:
include:
- { java-version: 21, cache: 'true', cleanup-node: false }
- { java-version: 22, cache: 'restore', cleanup-node: false }
- { java-version: 23-ea, cache: 'restore', cleanup-node: true }
timeout-minutes: 45
Expand Down
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21
22
1 change: 0 additions & 1 deletion .mvn/jvm.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
-XX:+UnlockDiagnosticVMOptions
-XX:GCLockerRetryAllocationCount=100
-XX:+ExitOnOutOfMemoryError
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ information about reporting vulnerabilities.
## Build requirements

* Mac OS X or Linux
* Java 21.0.1+, 64-bit
* Java 22.0.0+, 64-bit
* Docker
* Turn SELinux or other systems disabling write access to the local checkout
off, to allow containers to mount parts of the Trino source tree
Expand Down Expand Up @@ -70,8 +70,8 @@ After opening the project in IntelliJ, double check that the Java SDK is
properly configured for the project:

* Open the File menu and select Project Structure
* In the SDKs section, ensure that JDK 21 is selected (create one if none exist)
* In the Project section, ensure the Project language level is set to 21
* In the SDKs section, ensure that JDK 22 is selected (create one if none exist)
* In the Project section, ensure the Project language level is set to 22

### Running a testing server

Expand Down
3 changes: 0 additions & 3 deletions core/docker/default/etc/jvm.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
# Reduce starvation of threads by GClocker, recommend to set about the number of cpu cores (JDK-8192647)
-XX:+UnlockDiagnosticVMOptions
-XX:GCLockerRetryAllocationCount=32
# Allow loading dynamic agent used by JOL
-XX:+EnableDynamicAgentLoading
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static com.google.common.base.MoreObjects.firstNonNull;
import static com.google.common.base.Strings.nullToEmpty;
import static java.lang.String.format;

public final class TrinoServer
{
Expand All @@ -29,8 +28,8 @@ public static void main(String[] args)
String javaVersion = nullToEmpty(StandardSystemProperty.JAVA_VERSION.value());
String majorVersion = javaVersion.split("\\D", 2)[0];
Integer major = Ints.tryParse(majorVersion);
if (major == null || major < 21) {
System.err.println(format("ERROR: Trino requires Java 21+ (found %s)", javaVersion));
if (major == null || major < 22) {
System.err.printf("ERROR: Trino requires Java 22+ (found %s)%n", javaVersion);
System.exit(100);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
# Reduce starvation of threads by GClocker, recommend to set about the number of cpu cores (JDK-8192647)
-XX:+UnlockDiagnosticVMOptions
-XX:GCLockerRetryAllocationCount=32
# Allow loading dynamic agent used by JOL
-XX:+EnableDynamicAgentLoading
6 changes: 1 addition & 5 deletions core/trino-server-rpm/src/main/rpm/preinstall
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ check_if_correct_java_version() {
if ! check_if_correct_java_version "$JAVA_HOME"; then
java_found=false
for candidate in \
/usr/lib/jvm/java-21-* \
/usr/lib/jvm/java-22-* \
/usr/lib/jvm/zulu-21 \
/usr/lib/jvm/zulu-22 \
/usr/lib/jvm/temurin-21 \
/usr/lib/jvm/temurin-21-* \
/usr/lib/jvm/temurin-22 \
/usr/lib/jvm/temurin-22-* \
/usr/lib/jvm/default-java \
Expand All @@ -61,7 +57,7 @@ if [ "$java_found" = false ]; then
+======================================================================+
| Error: Required Java version could not be found |
+----------------------------------------------------------------------+
| JDK 21 was not detected. |
| JDK 22 was not detected. |
| Recommended JDK distribution is Eclipse Temurin. |
| Installation guide: https://adoptium.net/installation/linux/ |
| |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ public void testInstallUninstall()
throws Exception
{
// Release names as in the https://api.adoptium.net/q/swagger-ui/#/Release%20Info/getReleaseNames
testInstall("jdk-21.0.2+13", "/usr/lib/jvm/temurin-21", "21");
testUninstall("jdk-21.0.2+13", "/usr/lib/jvm/temurin-21");

testInstall("jdk-22+36", "/usr/lib/jvm/temurin-22", "22");
testUninstall("jdk-22+36", "/usr/lib/jvm/temurin-22");
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/admin/resource-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ evenly and each receive 50% of the queries in a given timeframe.
The selector rules for pattern matching use Java's regular expression
capabilities. Java implements regular expressions through the `java.util.regex`
package. For more information, see the [Java
documentation](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html).
documentation](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/regex/Pattern.html).

- `user` (optional): Java regex to match against user name.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/functions/conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Like {func}`cast`, but returns null if the cast fails.
## Formatting

:::{function} format(format, args...) -> varchar
Returns a formatted string using the specified [format string](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Formatter.html#syntax)
Returns a formatted string using the specified [format string](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Formatter.html#syntax)
and arguments:

```
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/sphinx/functions/regexp.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ SELECT regexp_split('1a 2b 14m', '\s*[a-z]+\s*'); -- [1, 2, 14, ]
```
:::

[capturing group number]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html#gnumber
[capturing groups]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html#cg
[java pattern]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html
[capturing group number]: https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/regex/Pattern.html#gnumber
[capturing groups]: https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/regex/Pattern.html#cg
[java pattern]: https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/regex/Pattern.html
11 changes: 3 additions & 8 deletions docs/src/main/sphinx/installation/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

### Java runtime environment

Trino requires a 64-bit version of Java 21, with a minimum required version of 21.0.1.
Earlier major versions such as Java 8, Java 11 or Java 17 do not work.
Newer major versions such as Java 22 are not supported -- they may work, but are not tested.
Trino requires a 64-bit version of Java 22, with a minimum required version of 22.0.0.
Earlier versions such as Java 8, Java 11, Java 17 or Java 21 do not work.
Newer versions such as Java 23 are not supported -- they may work, but are not tested.

We recommend using the Eclipse Temurin OpenJDK distribution from
[Adoptium](https://adoptium.net/) as the JDK for Trino, as Trino is tested
Expand Down Expand Up @@ -142,9 +142,6 @@ The following provides a good starting point for creating `etc/jvm.config`:
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
-Dfile.encoding=UTF-8
# Reduce starvation of threads by GClocker, recommend to set about the number of cpu cores (JDK-8192647)
-XX:+UnlockDiagnosticVMOptions
-XX:GCLockerRetryAllocationCount=32
# Allow loading dynamic agent used by JOL
-XX:+EnableDynamicAgentLoading
```
Expand Down Expand Up @@ -177,8 +174,6 @@ prevents Trino from starting. You can workaround this by overriding the
temporary directory by adding `-Djava.io.tmpdir=/path/to/other/tmpdir` to the
list of JVM options.

We set GCLocker retry allocation count (`-XX:GCLockerRetryAllocationCount=32`) to avoid OOM too early (see [JDK-8192647](https://bugs.openjdk.org/browse/JDK-8192647))

(config-properties)=

### Config properties
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/sphinx/security/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ using TLS 1.2 and TLS 1.3 certificates. The server rejects TLS 1.1, TLS 1.0, and
all SSL format certificates.

The Trino server does not specify a set of supported ciphers, instead deferring
to the defaults set by the JVM version in use. The documentation for Java 21
lists its [supported cipher suites](https://docs.oracle.com/en/java/javase/21/security/oracle-providers.html#GUID-7093246A-31A3-4304-AC5F-5FB6400405E2__SUNJSSE_CIPHER_SUITES).
to the defaults set by the JVM version in use. The documentation for Java 22
lists its [supported cipher suites](https://docs.oracle.com/en/java/javase/22/security/oracle-providers.html#GUID-7093246A-31A3-4304-AC5F-5FB6400405E2__SUNJSSE_CIPHER_SUITES).

Run the following two-line code on the same JVM from the same vendor as
configured on the coordinator to determine that JVM's default cipher list.
Expand Down Expand Up @@ -56,7 +56,7 @@ considered in conjunction with your organization's security managers. Using a
different suite may require downloading and installing a different SunJCE
implementation package. Some locales may have export restrictions on cipher
suites. See the discussion in Java documentation that begins with [Customizing
the Encryption Algorithm Providers](https://docs.oracle.com/en/java/javase/21/security/java-secure-socket-extension-jsse-reference-guide.html#GUID-316FB978-7588-442E-B829-B4973DB3B584).
the Encryption Algorithm Providers](https://docs.oracle.com/en/java/javase/22/security/java-secure-socket-extension-jsse-reference-guide.html#GUID-316FB978-7588-442E-B829-B4973DB3B584).

:::{note}
If you manage the coordinator's direct TLS implementatation, monitor the CPU
Expand Down
6 changes: 2 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@
</scm>

<properties>
<project.build.targetJdk>21</project.build.targetJdk>
<project.build.targetJdk>22</project.build.targetJdk>
<!-- TODO remove this property when no module overrides it -->
<trino.error-prone.guarded-by>ERROR</trino.error-prone.guarded-by>

<air.check.skip-spotbugs>true</air.check.skip-spotbugs>
<air.check.skip-pmd>true</air.check.skip-pmd>
<air.check.skip-jacoco>true</air.check.skip-jacoco>
<air.java.version>21.0.1</air.java.version>
<air.java.version>22.0.0</air.java.version>
<air.javadoc.lint>syntax,reference,html,-missing</air.javadoc.lint>
<air.main.basedir>${project.basedir}</air.main.basedir>
<air.modernizer.java-version>8</air.modernizer.java-version>
Expand All @@ -171,8 +171,6 @@
<air.test.jvm.additional-arguments.default>
-XX:G1HeapRegionSize=32M
-XX:+UnlockDiagnosticVMOptions
<!-- bump from default of 2 -->
-XX:GCLockerRetryAllocationCount=10
<!-- # Allow loading dynamic agent used by JOL -->
-XX:+EnableDynamicAgentLoading
</air.test.jvm.additional-arguments.default>
Expand Down

0 comments on commit d285be2

Please sign in to comment.