Pin AWS SDK to 2.44.4 to match the copy bundled in iceberg-aws-bundle - #377
Merged
Conversation
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
ferenc-csaky
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pins
software.amazon.awssdkto 2.44.4 via the AWS SDK BOM, matching the SDK version bundled insideiceberg-aws-bundle:1.11.0.Before this change the runner image shipped two unrelocated copies of AWS SDK v2 at different versions on the Flink system classpath:
/opt/flink/libiceberg-aws-bundle-1.11.0.jarauth,sts,aws-query-protocol,WebIdentityTokenFileCredentialsProvider, …sql-runner.uber.jarsoftware.amazon.msk.auth.iam.*+kafka-clients2.44.12arrives transitively throughaws-msk-iam-auth:2.3.7:Iceberg's
2.44.4is not a Maven edge — it is baked into the bundle jar — so Maven never sees the conflict and dependency convergence rules can't catch it.Classpath order on a running TaskManager (from
/proc/1/cmdline):Class loading is first-wins, so 2.44.4 is what actually loads, and the MSK IAM auth code — compiled against 2.44.12 — runs against 2.44.4 classes. Pinning makes the two copies semantically identical, so which one wins stops mattering. They are not byte-identical: the shade plugin renumbers the constant pool when it repackages, which flips some
ldctoldc_wand shifts every subsequent bytecode offset. Verified on the PR image by normalising pool indices out ofjavap -coutput — same instructions, same operands, same targets.Why now — the bug under investigation
On
dev-signature, TaskManagers running0.10.5-flink-2.2produced this during task teardown:The STS call returned 200 — IRSA is fine, this is not a permissions problem. The SDK simply could not unmarshal the response, and the failing code path is exactly
aws-query-protocol/AwsXmlErrorProtocolUnmarshaller, one of the classes duplicated across the two jars.Immediately before it, the same TaskManager logged:
That second one is a separate, pre-existing kafka-clients 4.2.0 issue:
Sender.run()'s force-close path callstransactionManager.beginAbort()guarded only ontransactionManager != null. An idempotent-but-non-transactional producer (enable.idempotence=true, notransactional.id) still has a non-nullTransactionManager, soensureTransactional()throws. It fires only onclose(Duration.ZERO), which Flink issues when cancelling a task. This PR does not address that — tracked separately.Both traces are teardown exhaust rather than the root cause, and the pod that produced them was later OOMKilled and evicted for exceeding its 20Gi
flink-local-dataEmptyDir limit. The duplicate-SDK skew is real regardless, and it is the cheapest of the three to remove — hence trying it first.Alternatives considered
Relocating
software.amazon.awssdkin the uber jar's shade config is the more correct fix and would make the two copies genuinely independent. It is also a much larger change with its own risk around the SDK's reflective/ServiceLoaderlookups. Trying the version pin first; if the skew turns out not to be the problem, shading is the next step.Note that
org.apache.kafka.*andsoftware.amazon.msk.*are also unrelocated in the uber jar and carry the same collision risk — out of scope here.Verification
mvn dependency:tree -Dincludes='software.amazon.awssdk:*'now reports a single version:mvn clean testpasses across all 23 modules.The pin carries a comment with the command to re-check the bundled version after any
iceberg.versionbump, since the two must move together.Also included: a comment on the S3A
core-site.xmlworkaroundSecond commit, docs only — no behaviour change.
While investigating, the
core-site.xmladded in #290 came up as a suspect. It is not related to the MSK failure: it configuresfs.s3a.aws.credentials.providerwithcom.amazonaws.auth.DefaultAWSCredentialsProviderChain, which is AWS SDK v1 and only affects the S3A filesystem. MSK IAM auth uses the separate SDK v2 (software.amazon.awssdk) chain.What did turn up is that the workaround is load-bearing in a non-obvious way:
flink-s3-fs-hadoop-2.2.1.jarshipscom/amazonaws/**unrelocated, and that is the only reason the unshaded class name incore-site.xmlresolves at all. If that jar is ever shaded, the setting silently stops applying and S3A IRSA breaks again with no error pointing here.Added a comment above the
RUNrecording that, plus a line explaining thatnoop.jarexists only to satisfyflink run's required JAR positional argument (from #317).docker build --checkpasses.