Skip to content

Backport fix for GCS over S3 disk broken by aws-sdk-cpp 1.11.771 to 25.8 - #103542

Merged
alexey-milovidov merged 2 commits into
ClickHouse:25.8from
Slach:backport-checksum-fix-to-25.8
May 7, 2026
Merged

alexey-milovidov merged 2 commits into
ClickHouse:25.8from
Slach:backport-checksum-fix-to-25.8

Conversation

@Slach

@Slach Slach commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Backport of commit 659369ead95 ("Fix very weird issue") to the 25.8 branch.

Problem

After bumping aws-sdk-cpp to 1.11.771 in PR #100582 (backported to 25.8.22), GCS over S3 disks stopped working with the following error on server startup:

Code: 499. DB::Exception: Response checksums mismatch
This error happened for S3 disk: While checking access for disk disk_gcs. (S3_ERROR)

The new SDK changed the default checksum behavior to WHEN_SUPPORTED, which means it automatically adds x-amz-checksum-algorithm: CRC32 headers to all S3 requests. GCS's S3-compatible API does not fully support AWS Flexible Checksums and returns checksum values that the SDK considers invalid.

Fix

Set checksumConfig to WHEN_REQUIRED in PocoHTTPClientConfiguration so that checksum headers are only sent when explicitly required (matching the behavior before SDK 1.11.771):

checksumConfig.requestChecksumCalculation = Aws::Client::RequestChecksumCalculation::WHEN_REQUIRED;
checksumConfig.responseChecksumValidation = Aws::Client::ResponseChecksumValidation::WHEN_REQUIRED;

This fix is already present in 25.10.x and 26.3.x but was never backported to 25.8.

See issue: #103232

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fixed S3_ERROR: Response checksums mismatch when using GCS over S3 disks after upgrading to 25.8.22 (caused by aws-sdk-cpp 1.11.771 enabling CRC32 flexible checksums by default, which GCS does not support).

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@Slach

Slach commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

@alesapin could you trigger CI/CD?

@Slach

Slach commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

@alesapin @alexey-milovidov could we trigger CI/CD here?

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [942ead5]

@alexey-milovidov alexey-milovidov self-assigned this May 6, 2026
@Slach

Slach commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Stress test (amd_tsan) failure analysis

The CI failure in Stress test (amd_tsan) is not related to this PR.

Root cause of the crash:

Code: 48. DB::Exception: Disk does not support WriteMode::Append. (NOT_IMPLEMENTED)

Stack trace points to MergeTree transactions trying to use WriteMode::Append on an object storage disk:

DiskObjectStorageTransaction::writeFile(... WriteMode::Append ...)
DataPartStorageOnDiskBase::writeTransactionFile(WriteMode)
IMergeTreeDataPart::appendCSNToVersionMetadata(...)
MergeTreeTransaction::afterCommit(...)
TransactionLog::finalizeCommittedTransaction(...)

Triggered by test 03362_merge_tree_with_background_refresh.sh — this is a pre-existing bug in 25.8 where MergeTree transactions attempt an append write on object storage, which object storage disks do not support.

This PR only modifies checksumConfig in PocoHTTPClientConfiguration (S3 client layer) — completely unrelated to DiskObjectStorage transaction handling.

Branch status: up to date with upstream/25.8, no merging needed.

@alexey-milovidov
alexey-milovidov merged commit 393f47f into ClickHouse:25.8 May 7, 2026
14 of 31 checks passed
zvonand added a commit to Altinity/ClickHouse that referenced this pull request May 11, 2026
Set RequestChecksumCalculation/ResponseChecksumValidation to WHEN_REQUIRED
to prevent the new AWS SDK from injecting x-amz-checksum-mode and
chunked transfer-encoding headers that MinIO does not support and that
break gtest_aws_s3_client's AppendExtraSSECHeaders* tests.

Same as upstream/25.8 commit c14a192 (merged via PR ClickHouse#103542),
which was not part of v25.8.23.13-lts.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Slach added a commit to Altinity/clickhouse-backup that referenced this pull request May 20, 2026
besteffects pushed a commit to besteffects/clickhouse-backup that referenced this pull request May 20, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants