Skip to content

Functional tests: ignore benign filesystem-cache background-download No such key - #112157

Merged
alexey-milovidov merged 2 commits into
masterfrom
ci-ignore-bg-download-nosuchkey
Jul 29, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
ci-ignore-bg-download-nosuchkey

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

...

Description

Stateless tests (amd_tsan, s3 storage, parallel, 1/3) fails on master with all 4050 tests green - only two server-log health checks fail, on the same single log line:

Report (efccb01cfb8d5c3cd65e763059f13337283b473e, an unrelated merge of #111725):

<Error> CacheMetadata: Error during background download of 1fd00bda8ebe086136a7332edb776c3f:0
(File segment: [0, 2038035], ..., state: PARTIALLY_DOWNLOADED_NO_CONTINUATION, ..., background download: 1):
Code: 499. DB::Exception: The specified key does not exist. This error happened for S3 disk:
while reading key: iij-first-random-part/new-style-prefix/qmf/ednctraocbznyybcdgqccrfbxmrzz, from bucket: test. (S3_ERROR)

The filesystem cache background download worker (CacheMetadata::downloadThreadFunc, src/Interpreters/FileCache/Metadata.cpp) continues prefetching a partially downloaded file segment. The underlying object can be removed concurrently (DROP, mutation, part removal), so the GET returns Code: 499 NoSuchKey; the worker catches it, marks the segment download as failed and logs the message without rethrowing - the data is simply re-read from the source later, so nothing is lost.

tests/docker_scripts/stress_tests.lib already ignores this line (#108489, merged 2026-06-28), but the functional tests jobs run their own copy of the scan in ci/jobs/scripts/clickhouse_proc.py, which did not get the exclusion. The token Error during background download is unique to that CacheMetadata log line, so a No such key reported from any other path is still flagged (e.g. the foreground merge-read variant of #111188 stays visible).

Chronic, unrelated to any PR: 3 occurrences of exactly this signature in Stateless tests (amd_tsan, s3 storage, parallel, 1/3) in the last 90 days (PR #110121 on 2026-07-14, PR #111029 on 2026-07-24, master on 2026-07-27), ~1 per run.

Drive-by cleanups in the same block:

  • the two checks (Lost s3 keys and S3_ERROR No such key thrown (...)) ran two copies of the same command that had already drifted apart by a stray double space - the command is now built once, so they cannot drift;
  • removed an accidentally duplicated Lost forever for SharedMergeTree check (the same name and command were appended twice).

Testing

ci/tests/test_lost_s3_keys_check.py runs ClickHouseProc.check_fatal_messages_in_logs against a fake log dir:

  • the verbatim log line from the failing master run alone -> both checks are OK;
  • the same line plus a No such key from a foreground merge read -> both checks FAIL and report the merge line, not the background-download one.

Both tests fail on master without the fix. Full pytest ci/tests/ passes locally (except the 4 test_print_stacktraces.py cases that require a live clickhouse-server).

Version info

  • Merged into: 26.8.1.370 (included in 26.8 and later)

…No such key

The "Lost s3 keys" / "S3_ERROR No such key thrown" checks of the functional
tests jobs report the filesystem cache background download worker error as a
lost object. The worker (CacheMetadata) keeps prefetching a partially
downloaded file segment whose remote object can be concurrently removed
(DROP, mutation, part removal), so the GET returns Code: 499 NoSuchKey, the
download is marked as failed and the data is re-read from the source later -
nothing is lost.

tests/docker_scripts/stress_tests.lib already ignores this line (#108489), the
functional tests checks did not, so `Stateless tests (*, s3 storage, *)` failed
with all tests green.

Both checks run the same scan, so the ignore list is built once. Also removed
an accidentally duplicated "Lost forever for SharedMergeTree" check.
@clickhouse-gh

clickhouse-gh Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b407a54]

Summary: ✅


AI Review

Summary

This PR aligns check_fatal_messages_in_logs with the existing stress-test log filter by ignoring the benign filesystem-cache background-download NoSuchKey line, deduplicates the shared shell command used by the two No such key checks, and adds focused regression coverage for the benign-vs-real lost-key split. I did not find a correctness, scope, or evidence gap in the current patch.

Final Verdict
  • Status: ✅ Approve
  • The change is appropriately scoped to CI log triage, matches the pre-existing stress_tests.lib behavior, and the added test covers both the ignored cache-prefetch line and a genuine lost-key failure.

@alexey-milovidov

alexey-milovidov commented Jul 28, 2026 •

Copy link
Copy Markdown
Member Author

The single red job Stress test (arm_debug) is the known chronic Logical error: Inconsistent KeyCondition behavior (STID 5182-2f27) in MergeTreeDataSelectExecutor::markRangesFromPKRange. It is unrelated to this PR, which only touches the CI server-log health checks in ci/jobs/scripts/clickhouse_proc.py and their new unit test. Fixes for the two classes behind that assertion are in flight, neither is on master yet:

Related: #109023 (widening-cast class, _CAST wrapper in the condition — the high-volume one in CI)
Related: #111964 (unloaded key-prefix class)

Merged master (the branch was 743 commits behind); the merge was clean and pytest ci/tests/test_lost_s3_keys_check.py still passes.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sounds good.

@alexey-milovidov alexey-milovidov self-assigned this Jul 29, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 29, 2026
Merged via the queue into master with commit e22ad16 Jul 29, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the ci-ignore-bg-download-nosuchkey branch July 29, 2026 16:35
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants