Skip to content

Do not abort on missing ETAG in AZURE - #130519

Merged
antaljanosbenjamin merged 6 commits into
masterfrom
azure-missing-etag-logical-error
Nov 17, 2026
Merged

antaljanosbenjamin merged 6 commits into
masterfrom
azure-missing-etag-logical-error

Conversation

@antaljanosbenjamin

@antaljanosbenjamin antaljanosbenjamin commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

My reasoning:
Azure::ETag::ToString calls AZURE_ASSERT, which is a bare std::abort in release builds — so an endpoint that omits the optional ETag header could take the whole server down, remotely, through any azureBlobStorage(...) call with a user-supplied URL.
ETag is optional only on paper: Azure itself and every known compatible implementation (including Azurite and azurite-rs, which our CI runs against) send it in every GetProperties, ListBlobs and Download answer.
Hence we refuse it outright instead of handling it gracefully:

  • Propagating an empty etag (the alternative explored in Harden the consumers of ETag (Iceberg version hint, ObjectStorageQueue deduplication) against a missing tag #120908) silently weakens everything that relies on the tag — read-generation validation, per-chunk dedup tokens, the Iceberg version-hint compare-and-swap — and would require fail-close hardening in each consumer, for endpoints that do not legitimately exist.
  • A regular storage error would bury these endpoints among ordinary user mistakes. LOGICAL_ERROR is deliberate: production runs release builds, where it is just a failed query, while staying on the logical-error monitoring radar — so non-conformant endpoints get noticed.
    Trade-offs accepted: an innocent header-stripping proxy in front of real Azure gets the same refusal (the message states the endpoint is non-conforming), and since constructing LOGICAL_ERROR aborts debug/sanitizer builds, the regression tests run in release builds only.

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC)

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

Treat an Azure answer without an ETag as LOGICAL_ERROR


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

Version info

  • Merged into: 26.11.1.2643-master (included in 26.11 and later)

@clickhouse-gh

clickhouse-gh Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0f55c53]

Summary: ❌

job_name test_name status info comment
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/new_tests_check.py FAIL IGNORED

AI Review

Summary

Reviewed #130519 at 0f55c5341f0cc32c3922253b2dc6d1a15ead31f6. The change rejects missing or empty Azure ETag values with LOGICAL_ERROR and uses the shared guard in pinned-read validation. The earlier empty-tag correctness blocker is addressed. Regression coverage remains insufficient; no new inline findings were posted, and the dismissed testing thread remains closed.

Findings

⚠️ Majors

  • src/Disks/tests/gtest_azure_read_buffer_missing_etag.cpp:78 (deleted) — [dismissed by author -- https://github.com/Do not abort on missing ETAG in AZURE #130519#discussion_r4529265463] Deleting this fixture removes the only test exercising a download without an ETag; the remaining Azure read fixtures supply nonempty tags. Neither the intended release-build exception nor the new empty-header rejection has regression coverage. The deliberate debug/sanitizer abort policy does not remove the need to verify release behavior before metadata or body bytes reach consumers. Restore focused coverage adapted to that policy.
Tests
  • ⚠️ Retain a small mock-transport regression test for an absent header and a present-but-empty header. Assert LOGICAL_ERROR in release builds and verify rejection before body consumption. A release-only test can cover the intended production behavior; a death test can cover debug/sanitizer behavior.
Missing context / blind spots
  • ⚠️ The current finish report reports that the pipeline was limited by review threads and requires a full-suite rerun. It also reports No new tests have been added. Zero-test unit/integration entries do not establish runtime coverage. A completed full CI run and the focused regression test would close this evidence gap. No local build or tests were run.
Final Verdict

⚠️ Request changes — restore regression coverage for missing and empty ETag responses and obtain the full CI result. The prior coverage concern remains in this summary only, respecting the decision on its thread.

@clickhouse-gh clickhouse-gh Bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Nov 10, 2026
@SmitaRKulkarni SmitaRKulkarni self-assigned this Nov 10, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-azure Azure Blob Storage integration (credentials, multipart, Azure-specific IO). label Nov 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

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

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

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.

Compile time of recompiled translation units

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

Job report

@SmitaRKulkarni SmitaRKulkarni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@watson-ch

watson-ch Bot commented Nov 17, 2026

Copy link
Copy Markdown

Backport labels have been automatically added based on https://github.com/clickhouse/clickhouse-core-incidents/issues/1193

Labels added:

  • v26.2-must-backport
  • v26.4-must-backport
  • v26.6-must-backport
  • v26.8-must-backport

These labels ensure backport PRs are properly created for each affected release version. The release automation will create backport PRs as needed based on these labels.

@antaljanosbenjamin
antaljanosbenjamin added this pull request to the merge queue Nov 17, 2026
Merged via the queue into master with commit c747a49 Nov 17, 2026
385 of 388 checks passed
@antaljanosbenjamin
antaljanosbenjamin deleted the azure-missing-etag-logical-error branch November 17, 2026 21:08
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 17, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 17, 2026
alexey-milovidov added a commit that referenced this pull request Nov 22, 2026
Conflicts are with #130519 and its follow-ups on
master, which fixed the abort in `Azure::ETag::ToString` the other way: `AzureBlobStorage::getETag`
throws `LOGICAL_ERROR` when the endpoint omits the `ETag`, and the read path now pins a download to
the listed `ETag`.

Resolution: master's design is kept for the Azure code. `AzureBlobStorageCommon`,
`AzureObjectStorage.cpp` and `ReadBufferFromAzureBlobStorage.cpp` are taken from master, so
`getETagOrEmpty` is gone, and `gtest_azure_object_storage_metadata.cpp`, which pinned an empty tag
from an Azure answer, is removed. What remains of this change is the hardening of the consumers of
an `ETag` (Iceberg `version-hint.text`, `ObjectStorageQueue` deduplication token), which still
applies to storages that may not report a tag.

Other conflicts are textual: `CachedObjectStorage.h` (`[[nodiscard]]`),
`gtest_metadata_plain_rewritable_disk.cpp` (both tests kept), `AlterDropPartitionExecutor.cpp`
(statistics file is written before the guarded commit), `StorageObjectStorageQueue.cpp` (log line).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-azure Azure Blob Storage integration (credentials, multipart, Azure-specific IO). pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.2-must-backport v26.4-must-backport v26.6-must-backport v26.8-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants