Skip to content

Log the first failed CAS blob publication attempt below Warning - #2594

Merged
filimonov merged 1 commit into
antalya-26.6from
fix/antalya-26.6/cas-blob-attempt-log-level
Nov 4, 2026
Merged

filimonov merged 1 commit into
antalya-26.6from
fix/antalya-26.6/cas-blob-attempt-log-level

Conversation

@filimonov

Copy link
Copy Markdown
Member

The per-attempt CasBlobPublishAttempt warning of #2555 reached clients with send_logs_level=warning and failed two stateless tests on stderr in stateless asan cas s3 2/2: 02907_filter_pushdown_crash and 03254_pr_join_on_dups. Both saw Publication of CAS blob ... failed, attempt 1 of 8: ... Connection refused; attempt 2 succeeded.

The first failed attempt is now logged at Information. Attempt 2 and later, and the give-up path, stay at Warning. CASBlobPublishAttemptFailed and CASBlobPublishGaveUp are unchanged.

Test: CASBlobPublishTransport.FirstFailedAttemptIsBelowWarning drops two PutObject responses and checks that attempt 1 is absent and attempt 2 present in a Warning-level capture. It failed before the change (attempt 1 logged once).

Related: #2555

Changelog category (leave one):

  • Improvement

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

CAS blob publication logs the first failed attempt at Information instead of Warning, so a single retried failure no longer reaches clients that request warning-level logs.

Documentation entry for user-facing changes

  • Not needed: the docs do not state the log level.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

A lone failed attempt (for example a refused connection) is retried and usually
succeeds, but the per-attempt warning reached clients with send_logs_level=warning
and failed stateless tests on stderr. Attempt 1 now logs at Information; attempt 2
and later stay at Warning. CASBlobPublishAttemptFailed and CASBlobPublishGaveUp
are unchanged.

Related: #2555

Signed-off-by: Mikhail Filimonov <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [6a1085e]

@filimonov
filimonov merged commit aedac0c into antalya-26.6 Nov 4, 2026
307 of 316 checks passed
@filimonov

Copy link
Copy Markdown
Member Author

Ported to antalya-26.8 in #2805 (commit a330030). Clean cherry-pick.

@alsugiliazova

Copy link
Copy Markdown
Member

PR #2594 distributed-systems audit

AI audit note: This review was generated by AI (Claude Opus 5.5).

Scope

The PR changes only the log level in recordFailedPublicationAttempt:

  • Attempt 1 is logged at Information.
  • Attempts 2 and later are logged at Warning.

It also adds one gtest, CASBlobPublishTransport.FirstFailedAttemptIsBelowWarning.

These are unchanged: the retry count, the backoff, envelope minting, the CASBlobPublishAttemptFailed and CASBlobPublishGaveUp profile events, and the give-up exception.

Model assumptions

  • Actors: the CAS part writer (PartWriteTxn::ensureBlobPresent), the S3-compatible object store, clients that receive server logs through send_logs_level, the server log, and the process-wide LogSeriesLimiter registry.
  • Channels: HEAD, PutObject, and CopyObject requests to the object store, retried up to 8 times with backoff. The log message goes through LOG_IMPL to the server log and, when send_logs_level allows it, to the client.
  • Failure model assumed by the code: any publication may be ambiguous, meaning it may have landed. Each retry runs HEAD again and mints a fresh envelope. The first failure is treated as routine, and the second as worth a warning.

Verified correct

  • attempt == 0 always means the first failure for the call. attempt is the loop index. Every loop iteration ends in one of three ways:

    • it returns on success;
    • it throws out of the loop (HEAD, metadata, deterministic, or unadmitted failures);
    • it reaches one of the two catch blocks, which call recordFailedPublicationAttempt and then continue.

    So the index never advances without a logged failure.

  • The fallback from ServerSideCopy to Streaming keeps the loop index. A failed staged copy at attempt 1 followed by a failed stream at attempt 2 is still logged at Warning.

  • The give-up path always comes after a Warning. With max_publication_attempts = 8, attempt 1 is never the final attempt.

Confirmed defects

Observability and diagnosability

Low: Information-level first attempts use up the shared log budget and hide Warning-level repeats

  • Impact: During a sustained object-store outage, some operators see only Warning-level logs. That includes servers configured with <level>warning</level> and clients using send_logs_level=warning. Those operators can see no CasBlobPublishAttempt lines at all in a 30-second window, even while publications keep failing on attempts 2 through 8. Before this PR, all five admitted lines were Warnings.

    LogSeriesLimiter also appends an accepted series X / Y summary to the first message of the next window. When that message is the Information-level one, the summary is lost too.

  • Anchors:

    • src/Disks/DiskObjectStorage/MetadataStorages/ContentAddressed/Pool/CasPartWriteTxn.cpp: recordFailedPublicationAttempt
    • src/Common/LoggingHelpers.cpp: the LogSeriesLimiter::LogSeriesLimiter constructor
  • Trigger: many concurrent inserts into a CAS disk during an S3 outage. Each new blob's first failure is logged immediately, while its attempt 2 waits for Retry::backoff(1). So in each window, Information-level first attempts take most of the five slots.

  • Why it is a defect: LogSeriesLimiter admits or rejects a message in its constructor, keyed only by logger name, before LOG_IMPL checks the level. Both levels share the single CasBlobPublishAttempt series. A message that the level filter then drops still uses a slot.

  • Fix direction: use a separate limiter series (a different logger name) for the attempt-1 Information line, or don't rate-limit it at all.

  • Regression test direction: within 30 seconds, log six first-attempt failures followed by one second-attempt failure. Then assert that a Warning-level capture contains the second-attempt line.

Low: The new test depends on limiter state left by earlier tests

  • Impact: FirstFailedAttemptIsBelowWarning asserts exactly one attempt 2 of line. It fails whenever four or more CasBlobPublishAttempt messages were logged in the same process during the previous 30 seconds.

    This doesn't happen in today's CI order. Only LostPutIsRepublishedWithAFreshEnvelope logs before it, and that uses one slot. But the outcome depends on test order and timing.

  • Anchors:

    • src/Disks/tests/gtest_cas_blob_publish_transport.cpp: CASBlobPublishTransport.FirstFailedAttemptIsBelowWarning
    • src/Disks/tests/cas_test_helpers.h: ScopedLogCapture
  • Trigger: unit_tests_dbms --gtest_filter='CASBlobPublishTransport.*' --gtest_repeat=3. On the third repeat, attempt 1 takes the fifth slot or a later one, and the limiter rejects attempt 2. Adding another CAS publish-fault test that runs earlier in the binary has the same effect.

  • Why it is a defect: ScopedLogCapture resets the logger's channel and level, but not the static LogSeriesLimiter series records. The test also doesn't check the CASBlobPublishAttemptFailed counter, which should go up by 2. So a line the limiter dropped looks the same as a line that was never logged.

  • Fix direction: clear the limiter series for this logger in the fixture. Alternatively, assert on the profile-event delta plus "no attempt-1 Warning" instead of an exact count of the attempt-2 line.

  • Regression test direction: run the suite locally with --gtest_repeat=3 or --gtest_shuffle.

Coverage summary

Fault class Status Note
Network / transport Reviewed Retry policy is unchanged.
Partition / availability N/A No quorum or leadership logic is touched.
Timing / ordering N/A No versioning or clock use is touched. The limiter's wall-clock window predates this PR.
Partial / gray failure Reviewed Handling of ambiguous publications is unchanged.
Idempotency and duplicates Reviewed Each attempt still mints a fresh envelope.
Backpressure and resource limits N/A No queues or buffers are touched.
Recovery and rollback Reviewed The give-up path and CASBlobPublishGaveUp are unchanged.
Configuration and version skew N/A Log level only; no wire or format change.
Security / trust N/A No authentication or authorization path is touched.
Observability and diagnosability Reviewed Two Low findings, listed above.

No classes were deferred.

Assumptions and limits

  • This is a static review at 6a1085ed; nothing was run.
  • The PR was motivated by a Connection refused on attempt 1 in stateless asan cas s3. That error is now hidden from clients rather than explained. The PR does this on purpose, so it isn't counted as a defect.

@alsugiliazova

Copy link
Copy Markdown
Member

PR #2594 CI verification

AI audit note: This review was generated by AI (Claude Opus 5.5).

Verdict

No failure is caused by this PR. Four checks are red. All of them come from code or images the PR doesn't touch, and each one also fails on many unrelated PRs and on the branch. The PR changes only a log level in CasPartWriteTxn.cpp and adds one gtest. The new gtest passed.

Summary

Category Count Failures
regression 0 None
cascade 1 Server died, caused by the GroupingAggregatedTransform abort
pre-existing-flaky 2 IcebergMetadataGenerator.ModifyColumnAfterItselfWithoutTypeIsNoop, Logical error: GroupingAggregatedTransform pushed bucket A twice
infrastructure 2 Grype scans of the keeper image and the server alpine image
unknown 0 None

There were 5 failures in total:

  • 1 was set aside as a cascade of another failure.
  • 2 were classified by the branch-baseline query.
  • 2 were image vulnerability findings.

None needed an individual investigation.

Failure details

Unit tests (asan_ubsan): IcebergMetadataGenerator.ModifyColumnAfterItselfWithoutTypeIsNoop

Category: pre-existing-flaky

  • Error: UBSan reports src/DataTypes/IDataType.h:380:67: runtime error: member call on null pointer of type 'DB::IDataType' inside the Iceberg metadata generator test. Nothing in this PR reaches Iceberg code.
  • History over 60 days, same job:
    • 1 of 39 branch runs failed.
    • 38 failures across 21 other PRs between 2026-10-07 and 2026-10-19. This was a known breakage during that window.
    • The test also fails under tsan (3 other PRs) and msan (2 other PRs).
  • The PR's own tests in this job: CASBlobPublishTransport.FirstFailedAttemptIsBelowWarning passed (308 ms). The other three CASBlobPublishTransport tests also passed.

Stateless tests (amd_binary, cas storage, parallel): GroupingAggregatedTransform logical error

Category: pre-existing-flaky. The Server died entry is its cascade.

  • What failed: every test passed (Failed: 0, Passed: 6050). The job is red because the server aborted on a LOGICAL_ERROR at src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp:63, in GroupingAggregatedTransform::pushData. That abort is what produced the Server died entry.
  • Relation to the PR: none. The stack trace is entirely in the aggregation pipeline, and the server error log contains no CasBlobPublishAttempt lines.
  • History:
    • In this job: 2 of 2 branch rows failed, plus 9 failures across 8 other PRs.
    • Across all stateless jobs: the same error (STID 3994-4c1d) failed on more than 60 other PRs and on the branch between 2026-10-07 and 2026-11-06. The affected jobs include amd_debug, amd_tsan, amd_msan, arm_binary, and the CAS and S3 variants.
    • This is a known aggregation bug, and it doesn't depend on the storage type.

GrypeScanKeeper and GrypeScanServer (-alpine)

Category: infrastructure

Notable green checks

  • The jobs that motivated the PR passed. Both halves of Stateless tests (amd_asan_ubsan, cas s3 storage, parallel) passed: 1/2 (5555 passed) and 2/2 (5588 passed). These are the jobs where 02907_filter_pushdown_crash and 03254_pr_join_on_dups had failed on stderr warnings.
  • The CAS stress tests passed. Stress test (amd_debug, cas s3 storage) and Stress test (amd_asan_ubsan, cas s3 storage) each reported Failures: 0/4.
  • The selected regression suites passed. Iceberg, OAuth, Parquet, S3 Export, and Swarms all finished OK. Their only non-passing results were xfail or skipped.

@alsugiliazova alsugiliazova added the verified Approved for release label Nov 24, 2026
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.

4 participants