Skip to content

[fix](S3)Downgrade the AWS SDK version to avoid impacting other S3-compatible services. - #58566

Merged
CalvinKirs merged 2 commits into
apache:masterfrom
CalvinKirs:master-s3-sdk
Dec 2, 2025
Merged

CalvinKirs merged 2 commits into
apache:masterfrom
CalvinKirs:master-s3-sdk

Conversation

@CalvinKirs

@CalvinKirs CalvinKirs commented Dec 1, 2025 •

Copy link
Copy Markdown
Member

…

This PR addresses an issue related to AWS SDK for Java v2 S3 client behavior described in: aws/aws-sdk-java-v2#5805

Starting from newer versions of the SDK, the S3 client introduces unexpected behavior that causes our application to fail during normal S3 operations. Due to this problem, we were forced to downgrade aws-s3 from the latest version to 2.29.x, which restored correct functionality. The regression affects stability in our production environment and prevents us from upgrading the SDK.

#57226

…mpatible services.

This PR addresses an issue related to AWS SDK for Java v2 S3 client behavior described in:
aws/aws-sdk-java-v2#5805

Starting from newer versions of the SDK, the S3 client introduces unexpected behavior that causes our application to fail during normal S3 operations. Due to this problem, we were forced to downgrade aws-s3 from the latest version to 2.29.x, which restored correct functionality. The regression affects stability in our production environment and prevents us from upgrading the SDK.
@Thearas

Thearas commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@CalvinKirs

Copy link
Copy Markdown
Member Author

run buildall

@CalvinKirs

Copy link
Copy Markdown
Member Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 34064 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit c613ff3595b839b33d781d07109262956802f5e2, data reload: false

------ Round 1 ----------------------------------
q1	17610	5131	4910	4910
q2	2029	362	216	216
q3	10200	1337	758	758
q4	10219	829	338	338
q5	7542	2459	2137	2137
q6	191	174	141	141
q7	968	801	640	640
q8	9373	1372	1006	1006
q9	7065	5313	5345	5313
q10	6856	2212	1804	1804
q11	543	315	297	297
q12	392	377	239	239
q13	17801	3716	3040	3040
q14	239	236	223	223
q15	611	516	514	514
q16	916	880	797	797
q17	609	754	548	548
q18	7555	7075	7056	7056
q19	1537	971	587	587
q20	337	348	233	233
q21	3891	2699	2331	2331
q22	1007	1000	936	936
Total cold run time: 107491 ms
Total hot run time: 34064 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5088	4985	4957	4957
q2	314	410	335	335
q3	2193	2674	2331	2331
q4	1374	1768	1304	1304
q5	4289	4450	4700	4450
q6	218	183	138	138
q7	2083	2049	1821	1821
q8	2662	2572	2498	2498
q9	7577	7518	7488	7488
q10	3081	3284	2829	2829
q11	580	515	500	500
q12	689	783	618	618
q13	3571	3933	3254	3254
q14	300	313	289	289
q15	560	513	527	513
q16	932	965	882	882
q17	1161	1414	1460	1414
q18	7939	7584	7618	7584
q19	873	802	831	802
q20	2057	2161	1959	1959
q21	5124	4411	4128	4128
q22	1053	1035	957	957
Total cold run time: 53718 ms
Total hot run time: 51051 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 182308 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit c613ff3595b839b33d781d07109262956802f5e2, data reload: false

query1	1084	409	395	395
query2	6579	1194	1193	1193
query3	6744	227	227	227
query4	25449	23362	22723	22723
query5	4485	673	518	518
query6	337	249	239	239
query7	4670	517	317	317
query8	340	256	251	251
query9	8774	2674	2688	2674
query10	531	371	319	319
query11	15352	14774	15023	14774
query12	182	123	118	118
query13	1698	577	467	467
query14	9701	6058	6039	6039
query15	218	205	193	193
query16	7487	712	539	539
query17	1264	791	643	643
query18	2041	444	351	351
query19	216	224	184	184
query20	141	135	127	127
query21	221	139	118	118
query22	3948	3950	3953	3950
query23	32973	32050	31941	31941
query24	8470	2461	2458	2458
query25	630	517	469	469
query26	1260	272	167	167
query27	2748	509	348	348
query28	4309	2185	2133	2133
query29	806	660	496	496
query30	311	244	217	217
query31	822	719	610	610
query32	83	82	76	76
query33	633	375	332	332
query34	842	891	564	564
query35	816	842	754	754
query36	896	936	837	837
query37	124	114	94	94
query38	3851	3835	3851	3835
query39	1470	1413	1406	1406
query40	228	135	125	125
query41	68	63	63	63
query42	130	120	116	116
query43	429	461	422	422
query44	1318	761	761	761
query45	201	193	188	188
query46	896	1034	670	670
query47	1670	1703	1648	1648
query48	394	441	329	329
query49	751	515	428	428
query50	674	725	440	440
query51	3907	3910	3970	3910
query52	114	113	107	107
query53	259	263	199	199
query54	314	300	281	281
query55	102	98	96	96
query56	334	329	327	327
query57	1122	1170	1106	1106
query58	295	276	275	275
query59	2340	2454	2333	2333
query60	371	352	337	337
query61	164	156	159	156
query62	805	734	665	665
query63	236	202	209	202
query64	4503	1217	1044	1044
query65	4040	4024	3965	3965
query66	1161	472	368	368
query67	15188	15219	14738	14738
query68	7757	968	636	636
query69	532	355	325	325
query70	1120	1037	1049	1037
query71	449	362	334	334
query72	5928	4960	4915	4915
query73	694	589	347	347
query74	8756	8789	8643	8643
query75	3041	3034	2563	2563
query76	3323	1154	763	763
query77	507	417	320	320
query78	9552	9493	8864	8864
query79	2259	841	578	578
query80	637	573	473	473
query81	517	276	243	243
query82	480	142	113	113
query83	264	261	243	243
query84	262	120	98	98
query85	950	502	443	443
query86	387	299	279	279
query87	3986	4068	3934	3934
query88	4111	2281	2272	2272
query89	390	331	299	299
query90	1936	247	218	218
query91	172	175	145	145
query92	89	69	72	69
query93	1934	1007	663	663
query94	782	451	342	342
query95	514	413	409	409
query96	521	547	283	283
query97	2659	2666	2586	2586
query98	246	226	210	210
query99	1312	1373	1266	1266
Total cold run time: 270587 ms
Total hot run time: 182308 ms

@doris-robot

Copy link
Copy Markdown
ClickBench: Total hot run time: 27.52 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit c613ff3595b839b33d781d07109262956802f5e2, data reload: false

query1	0.06	0.05	0.05
query2	0.09	0.05	0.04
query3	0.26	0.09	0.10
query4	1.60	0.11	0.10
query5	0.28	0.25	0.26
query6	1.18	0.64	0.64
query7	0.04	0.03	0.02
query8	0.05	0.04	0.04
query9	0.58	0.51	0.51
query10	0.56	0.56	0.56
query11	0.15	0.11	0.11
query12	0.16	0.11	0.12
query13	0.63	0.60	0.61
query14	0.99	0.98	0.98
query15	0.81	0.80	0.81
query16	0.40	0.39	0.42
query17	1.03	1.06	1.05
query18	0.23	0.20	0.21
query19	1.95	1.82	1.87
query20	0.01	0.01	0.01
query21	15.48	0.27	0.14
query22	4.83	0.05	0.05
query23	15.97	0.27	0.10
query24	1.25	0.68	0.30
query25	0.08	0.06	0.06
query26	0.14	0.13	0.14
query27	0.05	0.06	0.07
query28	3.19	1.24	1.02
query29	12.59	3.98	3.32
query30	0.28	0.13	0.12
query31	2.81	0.60	0.39
query32	3.23	0.54	0.48
query33	3.00	3.06	3.05
query34	16.54	5.21	4.54
query35	4.55	4.54	4.59
query36	0.68	0.53	0.49
query37	0.10	0.07	0.06
query38	0.07	0.05	0.04
query39	0.05	0.03	0.04
query40	0.18	0.14	0.15
query41	0.08	0.03	0.03
query42	0.05	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.3 s
Total hot run time: 27.52 s

@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@morningman morningman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Dec 2, 2025
@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@CalvinKirs CalvinKirs added dev/3.1.x dev/4.0.x and removed approved Indicates a PR has been approved by one committer. reviewed labels Dec 2, 2025
@CalvinKirs
CalvinKirs merged commit 21d56a5 into apache:master Dec 2, 2025
30 of 31 checks passed
github-actions Bot pushed a commit that referenced this pull request Dec 2, 2025
…mpatible services. (#58566)

…

This PR addresses an issue related to AWS SDK for Java v2 S3 client
behavior described in:
aws/aws-sdk-java-v2#5805

Starting from newer versions of the SDK, the S3 client introduces
unexpected behavior that causes our application to fail during normal S3
operations. Due to this problem, we were forced to downgrade aws-s3 from
the latest version to 2.29.x, which restored correct functionality. The
regression affects stability in our production environment and prevents
us from upgrading the SDK.

#57226
github-actions Bot pushed a commit that referenced this pull request Dec 2, 2025
…mpatible services. (#58566)

…

This PR addresses an issue related to AWS SDK for Java v2 S3 client
behavior described in:
aws/aws-sdk-java-v2#5805

Starting from newer versions of the SDK, the S3 client introduces
unexpected behavior that causes our application to fail during normal S3
operations. Due to this problem, we were forced to downgrade aws-s3 from
the latest version to 2.29.x, which restored correct functionality. The
regression affects stability in our production environment and prevents
us from upgrading the SDK.

#57226
yiguolei pushed a commit that referenced this pull request Dec 2, 2025
… other S3-compatible services. #58566 (#58608)

Cherry-picked from #58566

Co-authored-by: Calvin Kirs <guoqiang@selectdb.com>
morrySnow pushed a commit that referenced this pull request Dec 4, 2025
… other S3-compatible services. #58566 (#58607)

Cherry-picked from #58566

Co-authored-by: Calvin Kirs <guoqiang@selectdb.com>
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
…mpatible services. (apache#58566)

…

This PR addresses an issue related to AWS SDK for Java v2 S3 client
behavior described in:
aws/aws-sdk-java-v2#5805

Starting from newer versions of the SDK, the S3 client introduces
unexpected behavior that causes our application to fail during normal S3
operations. Due to this problem, we were forced to downgrade aws-s3 from
the latest version to 2.29.x, which restored correct functionality. The
regression affects stability in our production environment and prevents
us from upgrading the SDK.

apache#57226
laskoviymishka added a commit to laskoviymishka/doris that referenced this pull request Oct 13, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Upgrade the Iceberg Java SDK from 1.11.0 to 1.12.0.
1.12.0 brings the client side of REST catalog labels (`Labels`,
`SupportsLabels`, labels on `LoadTableResponse`, see apache/iceberg#15750,
apache#18045, apache#18046), which Doris needs before it can expose catalog-provided
labels for iceberg tables. This change only upgrades the dependency and
adapts Doris to it.

- Bump `iceberg.version` 1.11.0 -> 1.12.0, and `avro.version`
  1.12.1 -> 1.12.2 to stay consistent with what iceberg 1.12.0 is built
  against (the pom requires the two to move together).
- Bump the explicit caffeine pin in fe-connector-iceberg 2.9.3 -> 3.2.4.
  Iceberg 1.12.0 moved to caffeine 3. The pin is a direct dependency, so
  it wins Maven mediation; leaving it at 2.9.3 would package an older
  caffeine into the iceberg plugin than iceberg-core is built against.
- Re-vendor `org.apache.iceberg.DeleteFileIndex` from 1.12.0 and re-apply
  the Doris changes (public class/builder methods, schemasById comment,
  equality-field-id sets). The vendored class shadows the SDK class in
  the same package, and 1.12.0 changed it (an extra `specsById` constructor
  argument and delete/data file partition-match validation), so keeping
  the 1.11.0 copy would break the SDK's own callers at runtime.
  Since Doris passes `specsById` to the builder, the cached scan planning
  path now also rejects delete files whose partition spec or tuple does
  not match the data file, the same as upstream iceberg.
- Pass `table.specs()` to `ManifestFiles.read` in `IcebergManifestCache`.
  Iceberg 1.12.0 removed the deprecated `read(ManifestFile, FileIO)`
  overload, which read the partition specs from the manifest file's own
  metadata (only possible for Avro manifests). This matches the delete
  manifest path next to it (`readDeleteManifest(..., table.specs())`)
  and `IcebergRemoveOrphanFilesAction`.
- Keep the AWS SDK at 2.29.52 and default iceberg-aws's HTTP client to
  `urlconnection`. In 1.12.0, iceberg-aws's default `http-client.type`
  (`apache`) builds an `Apache5HttpClient` from
  `software.amazon.awssdk:apache5-client`, which first shipped in AWS SDK
  2.32. Doris pins 2.29.52 on purpose (apache#58566: newer SDKs add default S3
  integrity checksums that break S3-compatible services), so with the
  default every S3FileIO, Glue and STS client iceberg builds failed with
  `NoClassDefFoundError: software/amazon/awssdk/http/apache5/Apache5HttpClient$Builder`.
  `IcebergCatalogFactory.buildBaseCatalogProperties`, the base of every
  catalog flavor, now sets `http-client.type=urlconnection` unless the
  catalog sets it. S3FileIO keeps the setting when it is serialized, so
  the BE iceberg metadata scanner, which rebuilds the FileIO from it,
  uses the same client; `url-connection-client` is added to that scanner,
  which only bundled `apache-client` and `netty-nio-client`. An explicit
  `http-client.type=apache` is rejected at CREATE/ALTER CATALOG instead of
  failing on the first S3 or Glue call.

`SchemaAwareDataTableScan` (the other vendored class) needs no change:
`DataTableScan`, `BaseTableScan`, `SnapshotScan` and `TableScanContext`
are identical between 1.11.0 and 1.12.0.

### Release note

Upgrade the Iceberg Java SDK to 1.12.0. Iceberg's AWS clients (S3FileIO,
Glue, STS) now use the URLConnection HTTP client by default, and the
`http-client.type=apache` catalog property is no longer accepted.

### Check List (For Author)

- Test: Unit Test
    - Added IcebergCatalogFactoryTest#buildBaseDefaultsIcebergAwsHttpClientToUrlConnection
      (builds a real S3 client builder with the default) and
      #buildBaseKeepsAnExplicitHttpClientType, and
      IcebergCatalogPropertiesTest#createTimeRulesRejectTheApacheHttpClientType;
      IcebergCatalogOptionsSnapshotTest snapshots now include the default.
    - `build.sh --fe` passes. Ran every iceberg FE unit test with
      run-fe-ut.sh (fe-connector-iceberg, fe-connector-metastore-iceberg,
      be-java-extensions/iceberg-metadata-scanner): 1630 tests, 0 failures,
      5 skipped.
    - Iceberg regression suites not run.
- Behavior changed: Yes.
    - Iceberg's AWS clients use the URLConnection HTTP client by default,
      so `http-client.apache.*` properties no longer apply, and
      `http-client.type=apache` is rejected at CREATE/ALTER CATALOG.
    - Iceberg scans whose delete files have a partition spec or partition
      tuple that does not match the data file now fail with a
      ValidationException (iceberg 1.12.0 behavior) instead of applying
      the deletes.
- Does this need documentation: No
laskoviymishka added a commit to laskoviymishka/doris that referenced this pull request Oct 13, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Upgrade the Iceberg Java SDK from 1.11.0 to 1.12.0.
1.12.0 brings the client side of REST catalog labels (`Labels`,
`SupportsLabels`, labels on `LoadTableResponse`, see apache/iceberg#15750,
apache#18045, apache#18046), which Doris needs before it can expose catalog-provided
labels for iceberg tables. This change only upgrades the dependency and
adapts Doris to it.

- Bump `iceberg.version` 1.11.0 -> 1.12.0, and `avro.version`
  1.12.1 -> 1.12.2 to stay consistent with what iceberg 1.12.0 is built
  against (the pom requires the two to move together).
- Bump the explicit caffeine pin in fe-connector-iceberg 2.9.3 -> 3.2.4.
  Iceberg 1.12.0 moved to caffeine 3. The pin is a direct dependency, so
  it wins Maven mediation; leaving it at 2.9.3 would package an older
  caffeine into the iceberg plugin than iceberg-core is built against.
- Re-vendor `org.apache.iceberg.DeleteFileIndex` from 1.12.0 and re-apply
  the Doris changes (public class/builder methods, schemasById comment,
  equality-field-id sets). The vendored class shadows the SDK class in
  the same package, and 1.12.0 changed it (an extra `specsById` constructor
  argument and delete/data file partition-match validation), so keeping
  the 1.11.0 copy would break the SDK's own callers at runtime.
  Since Doris passes `specsById` to the builder, the cached scan planning
  path now also rejects delete files whose partition spec or tuple does
  not match the data file, the same as upstream iceberg.
- Pass `table.specs()` to `ManifestFiles.read` in `IcebergManifestCache`.
  Iceberg 1.12.0 removed the deprecated `read(ManifestFile, FileIO)`
  overload, which read the partition specs from the manifest file's own
  metadata (only possible for Avro manifests). This matches the delete
  manifest path next to it (`readDeleteManifest(..., table.specs())`)
  and `IcebergRemoveOrphanFilesAction`.
- Keep the AWS SDK at 2.29.52 and default iceberg-aws's HTTP client to
  `urlconnection`. In 1.12.0, iceberg-aws's default `http-client.type`
  (`apache`) builds an `Apache5HttpClient` from
  `software.amazon.awssdk:apache5-client`, which first shipped in AWS SDK
  2.32. Doris pins 2.29.52 on purpose (apache#58566: newer SDKs add default S3
  integrity checksums that break S3-compatible services), so with the
  default every S3FileIO, Glue and STS client iceberg builds failed with
  `NoClassDefFoundError: software/amazon/awssdk/http/apache5/Apache5HttpClient$Builder`.
  `IcebergCatalogFactory.buildBaseCatalogProperties`, the base of every
  catalog flavor, now sets `http-client.type=urlconnection` unless the
  catalog sets it. S3FileIO keeps the setting when it is serialized, so
  the BE iceberg metadata scanner, which rebuilds the FileIO from it,
  uses the same client; `url-connection-client` is added to that scanner,
  which only bundled `apache-client` and `netty-nio-client`. An explicit
  `http-client.type=apache` is rejected at CREATE/ALTER CATALOG instead of
  failing on the first S3 or Glue call.

- Report the mixed-version case clearly. FE sends iceberg system-table
  splits to the BE as Java-serialized iceberg objects, and iceberg 1.12.0
  changed the serialized form of classes every split carries (`BaseFile`,
  `PartitionData`, their anonymous inner classes; 24 serializable classes
  changed `serialVersionUID`). Unlike 1.11.0, where only `Schema` changed
  and is shimmed, this cannot be bridged by remapping UIDs, so while FE and
  BE run different iceberg versions (a rolling upgrade) iceberg system
  tables cannot be read. `IcebergSerializationCompat` now turns the bare
  `InvalidClassException` / `ClassNotFoundException` into an error naming
  the cause and the BE's iceberg version, and the shim comments no longer
  claim a shared wire across versions.

`SchemaAwareDataTableScan` (the other vendored class) needs no change:
`DataTableScan`, `BaseTableScan`, `SnapshotScan` and `TableScanContext`
are identical between 1.11.0 and 1.12.0.

### Release note

Upgrade the Iceberg Java SDK to 1.12.0. Iceberg's AWS clients (S3FileIO,
Glue, STS) now use the URLConnection HTTP client by default, and the
`http-client.type=apache` catalog property is no longer accepted. During a
rolling upgrade from a release on Iceberg 1.11, Iceberg system tables
(`tbl$snapshots`, `tbl$files`, ...) are unavailable until FE and BE are
both upgraded.

### Check List (For Author)

- Test: Unit Test
    - Added IcebergCatalogFactoryTest#buildBaseDefaultsIcebergAwsHttpClientToUrlConnection
      (builds a real S3 client builder with the default) and
      #buildBaseKeepsAnExplicitHttpClientType, and
      IcebergCatalogPropertiesTest#createTimeRulesRejectTheApacheHttpClientType;
      IcebergCatalogOptionsSnapshotTest snapshots now include the default.
    - Added IcebergSerializationCompatTest#reportsATaskFromAnotherIcebergVersion
      (a DataFile carrying Iceberg 1.11's BaseFile UID) and
      #reportsAClassThisIcebergDoesNotHave.
    - Verified the mixed-version break outside the build: a DataFile written
      with iceberg 1.11.0 cannot be read with 1.12.0 and vice versa, even
      after rewriting every changed class UID in the stream.
    - `build.sh --fe` passes. Ran every iceberg FE unit test with
      run-fe-ut.sh (fe-connector-iceberg, fe-connector-metastore-iceberg,
      be-java-extensions/iceberg-metadata-scanner): 1650 tests, 0 failures,
      5 skipped.
    - Iceberg regression suites not run.
- Behavior changed: Yes.
    - Iceberg's AWS clients use the URLConnection HTTP client by default,
      so `http-client.apache.*` properties no longer apply, and
      `http-client.type=apache` is rejected at CREATE/ALTER CATALOG.
    - Iceberg scans whose delete files have a partition spec or partition
      tuple that does not match the data file now fail with a
      ValidationException (iceberg 1.12.0 behavior) instead of applying
      the deletes.
    - While FE and BE run different iceberg versions (rolling upgrade from
      iceberg 1.11), iceberg system tables fail with an explicit
      "different Iceberg version" error until both sides are upgraded.
- Does this need documentation: No
laskoviymishka added a commit to laskoviymishka/doris that referenced this pull request Oct 13, 2026
…nnectivity probe

### What problem does this PR solve?

Issue Number: None

Related PR: apache#69031

Problem Summary: The iceberg 1.12.0 upgrade defaults iceberg-aws's HTTP
client to `urlconnection` in `IcebergCatalogFactory.buildBaseCatalogProperties`,
because iceberg-aws's default `apache` type is `Apache5HttpClient` since
1.12.0 and needs an AWS SDK newer than the 2.29.52 Doris pins (apache#58566).

The CREATE CATALOG storage connectivity probe does not go through that
method. `IcebergConnector.buildStorageProbeProperties` builds its own map
(only `s3.*` and `client.region`) and `probeStorage` loads an `S3FileIO`
from it, so the probe fell back to `apache` and building the S3 client
threw `NoClassDefFoundError: software/amazon/awssdk/http/apache5/Apache5HttpClient$Builder`.
That is an `Error`, not caught by the probe's `catch (Exception e)`, so it
never became a "connectivity test failed" result: CREATE CATALOG with
static S3 credentials failed with an unexpected exception whether the
credentials were right or wrong.

- Move the default into `IcebergCatalogFactory.applyDefaultAwsHttpClient`
  and apply it in both `buildBaseCatalogProperties` and
  `buildStorageProbeProperties`.
- Copy the catalog's `http-client.*` settings (client type, proxy,
  timeouts) into the probe map, so the probe reaches storage the same way
  the catalog does; `s3.*` still comes only from the bound storage.

The other places the connector builds AWS clients do not need it: every
catalog flavor (DLF included) goes through `buildBaseCatalogProperties`;
the s3tables control-plane client uses the s3tables library's own
`HttpClientProperties`, whose `apache` type is the v4 `ApacheHttpClient`
shipped with 2.29.52; DLF's own `S3Client` sets `UrlConnectionHttpClient`
explicitly; the STS assume-role client is a plain AWS SDK builder.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - Added IcebergConnectorTestConnectionTest#storageProbePropertiesBuildAnS3ClientOnTheShippedSdk
      (builds a real S3 client builder from the probe map on the shipped
      SDK) and #storageProbeUsesTheCatalogHttpClientSettings.
    - `build.sh --fe` passes. Ran every iceberg FE unit test with
      run-fe-ut.sh (fe-connector-iceberg, fe-connector-metastore-iceberg,
      be-java-extensions/iceberg-metadata-scanner): 1652 tests, 0 failures,
      5 skipped.
    - The external_table_p0/test_connection regression cases were not run
      (no docker regression environment available locally).
- Behavior changed: No (fixes a regression of the iceberg 1.12.0 upgrade
  in apache#69031 before it is released)
- Does this need documentation: No

Co-authored-by: Isaac <no-reply@databricks.com>
morningman pushed a commit that referenced this pull request Oct 15, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Upgrade the Iceberg Java SDK from 1.11.0 to 1.12.0.
1.12.0. This change only upgrades the dependency and adapts Doris to it.

- Bump `iceberg.version` 1.11.0 -> 1.12.0, and `avro.version` 1.12.1 ->
1.12.2 to stay consistent with what iceberg 1.12.0 is built against (the
pom requires the two to move together).
- Bump the explicit caffeine pin in fe-connector-iceberg 2.9.3 -> 3.2.4.
Iceberg 1.12.0 moved to caffeine 3. The pin is a direct dependency, so
it wins Maven mediation; leaving it at 2.9.3 would package an older
caffeine into the iceberg plugin than iceberg-core is built against.
- Re-vendor `org.apache.iceberg.DeleteFileIndex` from 1.12.0 and
re-apply the Doris changes (public class/builder methods, schemasById
comment, equality-field-id sets). The vendored class shadows the SDK
class in the same package, and 1.12.0 changed it (an extra `specsById`
constructor argument and delete/data file partition-match validation),
so keeping the 1.11.0 copy would break the SDK's own callers at runtime.
Since Doris passes `specsById` to the builder, the cached scan planning
path now also rejects delete files whose partition spec or tuple does
not match the data file, the same as upstream iceberg.
- Pass `table.specs()` to `ManifestFiles.read` in
`IcebergManifestCache`. Iceberg 1.12.0 removed the deprecated
`read(ManifestFile, FileIO)` overload, which read the partition specs
from the manifest file's own metadata (only possible for Avro
manifests). This matches the delete manifest path next to it
(`readDeleteManifest(..., table.specs())`) and
`IcebergRemoveOrphanFilesAction`.
- Keep the AWS SDK at 2.29.52 and default iceberg-aws's HTTP client to
`urlconnection`. In 1.12.0, iceberg-aws's default `http-client.type`
(`apache`) builds an `Apache5HttpClient` from
`software.amazon.awssdk:apache5-client`, which first shipped in AWS SDK
2.32. Doris pins 2.29.52 on purpose (#58566: newer SDKs add default S3
integrity checksums that break S3-compatible services), so with the
default every S3FileIO, Glue and STS client iceberg builds failed with
`NoClassDefFoundError:
software/amazon/awssdk/http/apache5/Apache5HttpClient$Builder`.
`IcebergCatalogFactory.buildBaseCatalogProperties`, the base of every
catalog flavor, now sets `http-client.type=urlconnection` unless the
catalog sets it. S3FileIO keeps the setting when it is serialized, so
the BE iceberg metadata scanner, which rebuilds the FileIO from it, uses
the same client; `url-connection-client` is added to that scanner, which
only bundled `apache-client` and `netty-nio-client`. An explicit
`http-client.type=apache` is rejected at CREATE/ALTER CATALOG instead of
failing on the first S3 or Glue call.

`SchemaAwareDataTableScan` (the other vendored class) needs no change:
`DataTableScan`, `BaseTableScan`, `SnapshotScan` and `TableScanContext`
are identical between 1.11.0 and 1.12.0.

### Release note

Upgrade the Iceberg Java SDK to 1.12.0. Iceberg's AWS clients (S3FileIO,
Glue, STS) now use the URLConnection HTTP client by default, and the
`http-client.type=apache` catalog property is no longer accepted.
Iceberg 1.12.0 no longer reads the S3 remote-signing properties
`s3.signer.uri` and `s3.signer.endpoint` and no longer defaults the
signer endpoint to `v1/aws/s3/sign`, so an Iceberg REST server that
enables S3 remote signing must send `signer.uri` / `signer.endpoint` or
serve the table-scoped sign endpoint. Iceberg system tables
(`$snapshots`, `$files`, ...) cannot be queried while FE and BE are on
different Iceberg versions (1.11 and 1.12), e.g. during a rolling
upgrade; they work again once every node is upgraded.

### Check List (For Author)

- Test: Unit Test
- Added
IcebergCatalogFactoryTest#buildBaseDefaultsIcebergAwsHttpClientToUrlConnection
(builds a real S3 client builder with the default) and
#buildBaseKeepsAnExplicitHttpClientType, and
IcebergCatalogPropertiesTest#createTimeRulesRejectTheApacheHttpClientType;
IcebergCatalogOptionsSnapshotTest snapshots now include the default.
- `build.sh --fe` passes. Ran every iceberg FE unit test with
run-fe-ut.sh (fe-connector-iceberg, fe-connector-metastore-iceberg,
be-java-extensions/iceberg-metadata-scanner): 1630 tests, 0 failures, 5
skipped.
    - Iceberg regression suites not run.
- Behavior changed: Yes.
- Iceberg's AWS clients use the URLConnection HTTP client by default, so
`http-client.apache.*` properties no longer apply, and
`http-client.type=apache` is rejected at CREATE/ALTER CATALOG.
- Iceberg scans whose delete files have a partition spec or partition
tuple that does not match the data file now fail with a
ValidationException (iceberg 1.12.0 behavior) instead of applying the
deletes.
- S3 remote signing: iceberg 1.12.0 no longer reads `s3.signer.uri` /
`s3.signer.endpoint` and no longer defaults the signer endpoint to
`v1/aws/s3/sign`. A REST catalog whose server turns on remote signing
but sends only those legacy keys, or relies on that default, fails to
read manifests. No compatibility shim is added: Doris does not use
remote signing to read data (BE uses static or vended credentials), and
`signer.uri` / `signer.endpoint` are deprecated in 1.12.0 and scheduled
for removal in 1.13.0.
- Iceberg system tables cannot be queried while FE and BE are on
different Iceberg versions (1.11 and 1.12), e.g. during a rolling
upgrade: iceberg 1.12.0 changed the serialized form of `BaseFile` and
`PartitionData`, which system table tasks carry. BE reports the version
mismatch instead of a bare `InvalidClassException`. Normal data scans
are not affected.
- Does this need documentation: No

Issue Number: related #68916

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants