Skip to content

Bump aws from 1.11.771 to 1.11.907 again, with aws-c-common v1.0.2 - #125080

Merged
thevar1able merged 2 commits into
ClickHouse:masterfrom
groeneai:reland-aws-1.11.907
Oct 12, 2026
Merged

thevar1able merged 2 commits into
ClickHouse:masterfrom
groeneai:reland-aws-1.11.907

Conversation

@groeneai

@groeneai groeneai commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #124678
Related: #125030
Related: #125039

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Update aws-sdk-cpp to 1.11.907, the AWS CRT libraries to the 0.43.8 release set, and aws-c-common to 1.0.2.

Description

This re-lands #124678, reverted by #125030, together with aws-c-common v1.0.2, which carries the upstream fix for the race that caused the revert.

With 1.11.907, Aws::Utils::Base64::Base64::Encode delegates to aws_base64_encode, so the Content-MD5 of every S3 write goes through it. Its first call caches the AVX2 check in the unsynchronized global cpuid_state; the first call on one thread and a later call on another race on it, and the amd_tsan server aborts (report). Since v1.0.2 (awslabs/aws-c-common#1280), aws_common_library_init runs that detection once, and ClickHouse reaches it through Aws::InitAPI in S3::ClientFactory before any request.

  • Commit 1 is Bump aws from 1.11.771 to 1.11.907 #124678 unchanged (same patch id); its notes on CVEs and on the ClickHouse-side CMake changes still apply.
  • Commit 2 moves only contrib/aws-c-common from v0.14.5 to v1.0.2, the pin of aws-crt-cpp v0.43.9. The v0.14.5..v1.0.2 diff removes or changes no public declaration and adds or removes no source file, so no CMake change is needed.

Validation on local TSan builds of commit 1 and commit 2:

  • Two threads calling aws_base64_encode after aws_common_library_init: 20/20 runs report the race on v0.14.5, 0/200 on v1.0.2 (20/20 on v1.0.2 without the init call).
  • test_s3_plain_rewritable_crash_recovery: on v0.14.5 the module fails with this report, as in CI; on v1.0.2, 3/3 full runs pass with no TSan report.
  • test_refreshable_mv (whole module) also passes on v1.0.2 with no TSan report.

Integration tests (amd_tsan, targeted) was skipped on #124678, so this PR's CI will likely not run these tests either; the numbers above are local.

If you prefer to keep aws-c-common at v0.14.5, #125039 ignores the race in the TSan build instead.


Workflow [PR]
Sync PR [sync-upstream/pr/125080]

Version info

  • Merged into: 26.10.1.2203-master (included in 26.10 and later)

groeneai and others added 2 commits October 10, 2026 12:49
This reverts ClickHouse#125030 (merge 18b5a99),
re-applying ClickHouse#124678 unchanged. The `ThreadSanitizer` race it exposed is
fixed by the next commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since 1.11.907, `Aws::Utils::Base64::Base64::Encode` delegates to
`aws_base64_encode`, which caches the AVX2 check in the unsynchronized
global `cpuid_state` on its first call. Two concurrent S3 writes then
race on it and the `amd_tsan` server aborts:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=4915e63c4bc867f6e30b56c0742e63dc333e32f3&name_0=MasterCI&name_1=Integration%20tests%20%28amd_tsan%2C%206%2F6%29

v1.0.2 includes awslabs/aws-c-common#1280, which runs the detection in
`aws_common_library_init`, reached from `Aws::InitAPI` in
`S3::ClientFactory` before any request. It is the `aws-c-common` pin of
aws-crt-cpp v0.43.9; the v0.14.5..v1.0.2 diff only adds API.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Oct 10, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 2 findings) plus my own review (1 nit).

# Sev Finding Verdict Evidence / action
1 ⚠️ 1.11.907 adds Expect: 100-continue to streaming S3 writes (AWSClient.cpp:1384), which may break endpoints or proxies DISAGREE Excluded from SigV4 (AWSAuthV4Signer.cpp:67); ClickHouse writes the body without waiting and Poco skips the interim 100 (HTTPClientSession.cpp:356-373); all 768 runs of the 24 S3-through-proxy tests passed on the 6 master commits with the bump. Pre-bump headers are one line: disableExpectHeader = true in PocoHTTPClientConfiguration.
2 ⚠️ The race fix needs two-direction TSan evidence DISAGREE Already measured: repro 20/20 on v0.14.5 vs 0/200 on v1.0.2 (20/20 on v1.0.2 without init); test_s3_plain_rewritable_crash_recovery fails with the cpuid_state report on v0.14.5, 3/3 clean on v1.0.2.
3 💡 "only adds API" is imprecise: v1.0.2 also changes behaviour ClickHouse does not use AGREE PR description reworded.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-9:20261010-140400

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Oct 10, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Two threads calling aws_base64_encode after aws_common_library_init under TSan: 20/20 runs report the cpuid_state race on v0.14.5; test_s3_plain_rewritable_crash_recovery reproduces the CI report locally.
b Root cause explained? Yes. aws_common_private_has_avx2 caches the AVX2 check in an unsynchronized global on first call; since 1.11.907 every S3 write's Content-MD5 reaches it, so calls on two threads race.
c Fix matches root cause? Yes. v1.0.2 (awslabs/aws-c-common#1280) runs the detection in aws_common_library_init, reached via Aws::InitAPI before any request; the function stays TSan-instrumented, so nothing is suppressed.
d Test intent preserved / new tests added? No test touched. The two existing carriers (test_s3_plain_rewritable_crash_recovery, test_refreshable_mv) stay the regression check on amd_tsan.
e Both directions demonstrated? Yes: repro 20/20 on v0.14.5 vs 0/200 on v1.0.2 (20/20 on v1.0.2 without init); carrier module red on v0.14.5, 3/3 green on v1.0.2.
f Fix is general across code paths? Yes. All cpuid_state accesses are in one function (base64 encode and decode); ClickHouse uses the SDK only through S3::ClientFactory, which calls Aws::InitAPI first; no other aws frame appeared in TSan CI while the bump was on master.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A for data types (library init order). aarch64 has no such global (the AVX2 check is a stub there). All platforms are built by PR CI.
h Backward compatible? (maintainer-approved exception only) Yes. No setting, format or protocol change; no source file is added or removed, so the build files are unchanged.
i Invariants and contracts preserved? Yes. aws_common_library_init keeps its once-guard and still runs single-threaded inside the ClientFactory static; the cached value is the same CPU fact, now computed eagerly.

Session id: cron:clickhouse-impl-slot-4:20261010-124700

@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b17d968]

Summary: ✅


AI Review

Summary

This PR re-lands the aws-sdk-cpp 1.11.907 bump, updates the in-tree AWS build glue for the newer SDK/CRT source layout, and moves aws-c-common to 1.0.2 to pick up the upstream fix for the TSan race that forced the earlier revert. I reviewed the current diff, the AWS initialization paths used by the S3, Glue, S3 Tables, backup, Keeper, and Kafka IAM entrypoints, the prior PR discussion, and the current all-green CI; although the targeted amd_tsan shards still selected zero tests, the deterministic local before/after TSan evidence in the PR description plus the broad green CI are sufficient here. I did not find an unresolved correctness, safety, or integration issue.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-build Pull request with build/testing/packaging improvement submodule changed At least one submodule changed in this PR. labels Oct 10, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-external-dependencies Third-party deps updates in contrib/, vendored code, and platform base libraries. label Oct 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing b17d96836 with master 5be322a6b (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

⚠️ Significant changes: object file sizes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 781.37 MiB 775.53 MiB -5.85 MiB (-0.75%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes ⚠️

915 object files changed (-3.96 MiB total), 159 added.

Object file Master PR Δ
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-glue/source/GlueClient1.cpp.o 5.60 MiB 1.14 MiB -4.46 MiB (-79.60%)
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-glue/source/GlueClient.cpp.o 6.02 MiB 1.59 MiB -4.43 MiB (-73.57%)
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-s3/source/S3Client.cpp.o 6.83 MiB 2.74 MiB -4.08 MiB (-59.82%)
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-glue/source/GlueClient2.cpp.o 3.36 MiB 569.57 KiB -2.81 MiB (-83.46%)
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/smithy/client/AwsSmithyCli… new 1.14 MiB +1.14 MiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnn… new 253.71 KiB +253.71 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/http/crt/CRTHttpClient.cpp… 338.89 KiB 552.99 KiB +214.10 KiB (+63.18%)
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/endpoint/BDDEndpointProvid… new 206.69 KiB +206.69 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnn… new 195.65 KiB +195.65 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucket… new 189.54 KiB +189.54 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/smithy/client/schema/Schem… new 186.06 KiB +186.06 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/smithy/client/schema/XmlSh… new 183.53 KiB +183.53 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-s3/source/model/DeleteObject… new 179.47 KiB +179.47 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAn… new 171.54 KiB +171.54 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/smithy/client/schema/Query… new 167.34 KiB +167.34 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/smithy/client/schema/JsonS… new 130.75 KiB +130.75 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-glue/source/model/IcebergTab… new 122.72 KiB +122.72 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/src/aws-cpp-sdk-core/source/smithy/client/schema/XmlSh… new 113.50 KiB +113.50 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-glue/source/model/DataQualit… new 111.41 KiB +111.41 KiB
contrib/aws-cmake/CMakeFiles/_aws.dir/__/aws/generated/src/aws-cpp-sdk-glue/source/model/ListIntegr… new 109.34 KiB +109.34 KiB

719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

2151 translation units recompiled, 3066 s compile time in total, 2151 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×0.94 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost -299.8 s (-9%) in total before that adjustment.

Job report

@thevar1able
thevar1able added this pull request to the merge queue Oct 12, 2026
@thevar1able thevar1able self-assigned this Oct 12, 2026
Merged via the queue into ClickHouse:master with commit 77da2f9 Oct 12, 2026
163 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-external-dependencies Third-party deps updates in contrib/, vendored code, and platform base libraries. groeneai-origin-request PR origin: a maintainer pinged or directed groeneai manual approve Manual approve required to run CI pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants