diff --git a/CHANGELOG.md b/CHANGELOG.md index 625dd54c0..5b0105f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file. - opensearch: Scope CycloneDX SBOM to shipped components only, eliminating false positive CVEs from unshipped plugins ([#1452]). - vector: Look for SBOM in correct location ([#1471]). - vector: Use correct license ([#1476]). +- trino: Build a patched Airlift from source and depend on it to backport [airlift/airlift#1943](https://github.com/airlift/airlift/pull/1943), applying the configured max response header size to Jetty's `maxResponseHeaderSize` ([#1510]). ### Removed @@ -40,6 +41,7 @@ All notable changes to this project will be documented in this file. [#1481]: https://github.com/stackabletech/docker-images/pull/1481 [#1493]: https://github.com/stackabletech/docker-images/pull/1493 [#1509]: https://github.com/stackabletech/docker-images/pull/1509 +[#1510]: https://github.com/stackabletech/docker-images/pull/1510 ## [26.3.0] - 2026-03-16 diff --git a/trino/airlift/Dockerfile b/trino/airlift/Dockerfile new file mode 100644 index 000000000..1858a032a --- /dev/null +++ b/trino/airlift/Dockerfile @@ -0,0 +1,39 @@ +# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7 +# check=error=true + +# We use a custom patched airlift version to fast track https://github.com/airlift/airlift/pull/1943 +# This can be removed once the PR is merged and Trino makes use of the new Airlift version containing the fix + +FROM local-image/java-devel AS airlift-builder + +ARG PRODUCT_VERSION +ARG RELEASE_VERSION +ARG STACKABLE_USER_UID + +WORKDIR /stackable + +COPY --chown=${STACKABLE_USER_UID}:0 trino/airlift/stackable/patches/patchable.toml /stackable/src/trino/airlift/stackable/patches/patchable.toml +COPY --chown=${STACKABLE_USER_UID}:0 trino/airlift/stackable/patches/${PRODUCT_VERSION} /stackable/src/trino/airlift/stackable/patches/${PRODUCT_VERSION} + +# hadolint ignore=SC2215 +RUN --mount=type=cache,id=maven-airlift-${PRODUCT_VERSION},target=/root/.m2/repository < +Date: Wed, 27 May 2026 21:58:48 +0200 +Subject: Apply max response header size to Jetty maxResponseHeaderSize + +--- + .../src/main/java/io/airlift/http/server/HttpServer.java | 2 +- + .../src/main/java/io/airlift/http/server/HttpServerConfig.java | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServer.java b/http-server/src/main/java/io/airlift/http/server/HttpServer.java +index 6da8193ebe..5a8f4009bf 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java +@@ -193,7 +193,7 @@ public class HttpServer + baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes())); + } + if (config.getMaxResponseHeaderSize() != null) { +- baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); ++ baseHttpConfiguration.setMaxResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); + } + if (config.getOutputBufferSize() != null) { + baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes())); +diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java +index c4ebbdf9d3..760f72347a 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java +@@ -372,6 +372,7 @@ public class HttpServerConfig + return this; + } + ++ @MaxDataSize("1GB") + public DataSize getMaxResponseHeaderSize() + { + return maxResponseHeaderSize; diff --git a/trino/airlift/stackable/patches/361/patchable.toml b/trino/airlift/stackable/patches/361/patchable.toml new file mode 100644 index 000000000..ceb89b96d --- /dev/null +++ b/trino/airlift/stackable/patches/361/patchable.toml @@ -0,0 +1,2 @@ +mirror = "https://github.com/stackabletech/airlift.git" +base = "69314d3f2d3a72533704b8ef08d68b23875c5513" diff --git a/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch new file mode 100644 index 000000000..cd9f8f419 --- /dev/null +++ b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch @@ -0,0 +1,35 @@ +From 359fe4dbf5154df20701cea742177bd874949009 Mon Sep 17 00:00:00 2001 +From: Lukas Krug +Date: Wed, 27 May 2026 21:58:48 +0200 +Subject: Apply max response header size to Jetty maxResponseHeaderSize + +--- + .../src/main/java/io/airlift/http/server/HttpServer.java | 2 +- + .../src/main/java/io/airlift/http/server/HttpServerConfig.java | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServer.java b/http-server/src/main/java/io/airlift/http/server/HttpServer.java +index 49a7de9374..fe3fa345aa 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java +@@ -204,7 +204,7 @@ public class HttpServer + baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes())); + } + if (config.getMaxResponseHeaderSize() != null) { +- baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); ++ baseHttpConfiguration.setMaxResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); + } + if (config.getOutputBufferSize() != null) { + baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes())); +diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java +index ee53d470f6..3abbfeaabb 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java +@@ -387,6 +387,7 @@ public class HttpServerConfig + return this; + } + ++ @MaxDataSize("1GB") + public DataSize getMaxResponseHeaderSize() + { + return maxResponseHeaderSize; diff --git a/trino/airlift/stackable/patches/386/patchable.toml b/trino/airlift/stackable/patches/386/patchable.toml new file mode 100644 index 000000000..5c7639fbe --- /dev/null +++ b/trino/airlift/stackable/patches/386/patchable.toml @@ -0,0 +1,2 @@ +mirror = "https://github.com/stackabletech/airlift.git" +base = "edaccb04be472282c74507af9b7c38470b385685" diff --git a/trino/airlift/stackable/patches/patchable.toml b/trino/airlift/stackable/patches/patchable.toml new file mode 100644 index 000000000..7db05dd49 --- /dev/null +++ b/trino/airlift/stackable/patches/patchable.toml @@ -0,0 +1,2 @@ +upstream = "https://github.com/airlift/airlift.git" +default-mirror = "https://github.com/stackabletech/airlift.git" diff --git a/trino/trino/Dockerfile b/trino/trino/Dockerfile index dc75f3ea4..389c2b950 100644 --- a/trino/trino/Dockerfile +++ b/trino/trino/Dockerfile @@ -1,21 +1,28 @@ # syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7 # check=error=true +FROM local-image/trino/airlift AS airlift-builder + FROM local-image/java-devel AS trino-builder ARG PRODUCT_VERSION ARG RELEASE_VERSION ARG STACKABLE_USER_UID +ARG TRINO_AIRLIFT_VERSION WORKDIR /stackable COPY --chown=${STACKABLE_USER_UID}:0 trino/trino/stackable/patches/patchable.toml /stackable/src/trino/trino/stackable/patches/patchable.toml COPY --chown=${STACKABLE_USER_UID}:0 trino/trino/stackable/patches/${PRODUCT_VERSION} /stackable/src/trino/trino/stackable/patches/${PRODUCT_VERSION} +COPY --chown=${STACKABLE_USER_UID}:0 --from=airlift-builder /stackable/patched-libs /stackable/patched-libs # adding a hadolint ignore for SC2215, due to https://github.com/hadolint/hadolint/issues/980 # hadolint ignore=SC2215 RUN --mount=type=cache,id=maven-${PRODUCT_VERSION},target=/root/.m2/repository < in +# https://github.com/trinodb/trino/blob/477/pom.xml +"trino/airlift" = "361" [versions."479".local-images] java-devel = "25" +# Airlift version comes from in +# https://github.com/trinodb/trino/blob/479/pom.xml +"trino/airlift" = "386"