Repository navigation
Stop a cache-warm read of an already-removed part from failing the lost-S3-keys checks - #113243
Open
tiandiwonder wants to merge 1 commit into
Open
tiandiwonder wants to merge 1 commit into
tiandiwonder wants to merge 1 commit into
Conversation
The `Lost s3 keys` and `S3_ERROR No such key thrown` checks failed on a job whose tests were all green, both quoting the same line: a background cache-warm read of a blob that had been deleted 0.99 s earlier together with the part that owned it. The read is best effort - the file segment never leaves `DOWNLOADING`, nothing is served from it, and `CacheWarmer` already treats a missing object as expected - so nothing is lost. The checks grep line by line, but an exception log entry spans many lines: message, stack trace, then a trailing `(version ...) (...)` line carrying whatever `addMessage` appended. `ReadBufferFromDistributedCache`, a logger the ignore list already covers, logs its fallback to object storage at `<Debug>`, and the addendum on its trailing line repeats the nested `Code: 499 ... The specified key does not exist`. That line carries no logger name, so no ignore matched it. Ignore `caller id: None:cache-warm` instead, mirroring the existing `caller id: None:DistribCache` entry. `FileSegment::getCallerId` renders a caller with no query id as `None:<thread name>:<tid>`, and the distributed cache client sends the same string as the query id when its calling thread has none, so every warmer read is tagged this way whether it goes through the distributed cache or straight to object storage. A genuinely lost blob still fails the queries that read the part, and those are reported. The ignore list and the command move to module level so `ci/tests` can run the real check against a fixture log: the verbatim line from the failing job must pass, a genuine `<Error> executeQuery` occurrence must fail, and the `-e` tokens of the `stress_tests.lib` copy must equal the Python list so the two cannot drift. Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
|
Workflow [PR], commit [6cf6dd4] Summary: ❌
AI ReviewSummaryThis PR narrows the Missing context / blind spots
Final Verdict✅ No findings. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Lost s3 keysandS3_ERROR No such key thrown (in clickhouse-server.log or clickhouse-server.err.log)checks both failed on a job whose tests were all green, quoting the same line (samerequest id):The reader is a background cache-warm task and the file segment is still
DOWNLOADINGwithdownloaded size: 0. From the job's server log, the blob was deleted 0.99 s before the read, legitimately, together with the part that owned it:keeper_retries_r2removesall_1_1_0deleteFileFromS3deletes the shared blobtest/ffx/avmoqhjkisdnuurkyppycsnrkkgjjCacheWarmer::downloaderThreadGETs that key →NoSuchKeyNoSuchKeyagainNothing is lost: cache warming is best effort, the segment never leaves
DOWNLOADING, andCacheWarmeralready treats a missing object as expected (it logsNO_SUCH_KEYat test level, noting the part was deleted and that this happens a lot in practice) — consistent with that, the warmer printed nothing here. The only cost is a red job.Root cause
The checks grep line by line, but a ClickHouse exception log entry spans many lines: the message, the stack trace, then a trailing
(version …) (…)line carrying whateveraddMessageappended.The entry that trips the checks is
<Debug> ReadBufferFromDistributedCache: Failed to read from distributed cache. Will read from object storage directly. Error: …— a logger the ignore list already covers. But the addendum on its trailing line repeats the nestedCode: 499 … The specified key does not exist, and that line carries no logger name, so none of the ignores matched it. Running the currentmastercommand over the job's 12 M-line server log leaves exactly this one line.Two things this rules out: severity is not the trigger (all 17 lines mentioning the key are
<Debug>/<Trace>, and the check is a plain text grep), and silencing the warmer would not help (the line is printed before the exception ever reaches it).Solution
Ignore
caller id: None:cache-warm, mirroring the existingcaller id: None:DistribCacheentry.FileSegment::getCallerIdrenders a caller with no query id asNone:<thread name>:<tid>, and the distributed-cache client sends the same string as the query id when its calling thread has none, so every cache-warmer read is tagged this way whether it goes through the distributed cache or straight to object storage. The ignore is narrow: a genuinely lost blob still fails the queries that read the part, and those are reported.Both copies of the scan are updated —
ci/jobs/scripts/clickhouse_proc.pyandcheck_logs_for_critical_errorsintests/docker_scripts/stress_tests.lib.The ignore list and the command move to module level so the check can be exercised from
ci/tests.ci/tests/test_no_such_key_ignores.pyruns the real command against a fixture log: the verbatim line from the failing job must pass, a genuine<Error> executeQuery: … Code: 499 …must fail, each ignored substring must suppress a line naming it while the same line without it is still reported, and the-etokens of thestress_tests.libcopy must equal the Python list so the two cannot drift.Verified against the failing job's own
clickhouse-server.log(2.1 GB decompressed): without the new ignore the check exits 1 quoting the byte-identical line from the CI report; with it the check is clean.CI report: https://s3.amazonaws.com/clickhouse-test-reports-private/PRs/67155/1182039bb62ad84459632386c2147ca05f0672a1/stateless_tests_amd_asan_ubsan_distributed_cache_meta_in_keeper_s3_storage_parallel_1_2.html (job
Stateless tests (amd_asan_ubsan, distributed cache, meta in keeper, s3 storage, parallel, 1/2)of ClickHouse/clickhouse-private#67155, where the failure was observed; it is pre-existing and not caused by that PR)Changelog category (leave one):