Repository navigation
Clear only the Protobuf cache in 03326_protobuf_schemas_race - #118391
Merged
alexey-milovidov merged 3 commits intoSep 11, 2026
Merged
Conversation
The test ran a bare `SYSTEM CLEAR FORMAT SCHEMA CACHE` a hundred times in a loop. Besides the in-memory Protobuf cache it also deletes every file of the on-disk `__cache__` directory under `format_schema_path`, which is shared by all tests of a parallel run. Any test relying on the cached schema of `format_schema_source = 'string'` or `'query'` that happened to run at the same time then failed with `CANNOT_PARSE_PROTOBUF_SCHEMA: File not found`, as `05055_format_schema_source_query_background_access` did in https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=107736&sha=c4de425e719ad1057d0da677efffe2fbd84a71b8&name_0=PR&name_1=Stateless%20tests%20(arm_binary,%20parallel) (#107736): the server log shows the schema stored at 08:31:14.867 and the `SELECT` failing at 08:31:15 while `03326` was clearing the cache every 0.27 s. The schema of `03326` is a plain file in its own directory, not an entry of `__cache__`, so the race it exercises is the one with the in-memory `ProtobufSchemas` cache only. Use `SYSTEM CLEAR FORMAT SCHEMA CACHE FOR Protobuf`. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Contributor
|
Workflow [PR], commit [8634599] Summary: ✅ AI ReviewSummaryThis PR narrows Final Verdict✅ No actionable findings in the current diff. |
…mat-schema-cache-for-protobuf
The flaky check of #118391 failed all eight runs of the test with `Test runs too long (> 180s)` (https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118391&sha=f9342e71cc9b1da430eb26a87373be051f357202&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20flaky%20check%29). The test is slow on master as well - it averages 170 s and peaks at 271 s in `Stateless tests (amd_asan_ubsan, distributed plan, parallel)` - so the flaky check only made the existing slowness visible. The slow part is not the cache clearing but the hundred separate `clickhouse-client` processes it was started from: locally the loop of 100 client invocations takes 5 s while the same 100 statements sent through a single connection take 0.075 s, and in a sanitizer build a client start costs over a second. Send a batch of the clearing queries through one connection instead, and keep repeating the batch for as long as the `INSERT` is running, so the race is exercised over the whole lifetime of the `INSERT` rather than a fixed number of times. The test now takes 1.6 s instead of 6 s locally, and its duration no longer depends on the client start time. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
alexey-milovidov
deleted the
fix/03326-clear-format-schema-cache-for-protobuf
branch
September 11, 2026 11:53
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.
Related: #107736
03326_protobuf_schemas_raceran a bareSYSTEM CLEAR FORMAT SCHEMA CACHEa hundred times in a loop. Besides the in-memory Protobuf cache, this also deletes every file of the on-disk__cache__directory underformat_schema_path, which is shared by all tests of a parallel run. Any test relying on the cached schema offormat_schema_source = 'string'or'query'that happened to run at the same time then failed withCANNOT_PARSE_PROTOBUF_SCHEMA: File not found.This is what happened to
05055_format_schema_source_query_background_accessin Stateless tests (arm_binary, parallel) of #107736, and on master the same day: the server log shows the schema of05055stored at08:31:14.867and itsSELECTfailing at08:31:15, while03326was clearing the cache every 0.27 s from08:31:03to08:31:30.The schema of
03326is a plain file in its own directory, not an entry of__cache__, so the race the test exercises is the one with the in-memoryProtobufSchemascache only. The loop now runsSYSTEM CLEAR FORMAT SCHEMA CACHE FOR Protobuf, which keeps the race and stops interfering with parallel tests. No open issue tracks this flake.The test is also slow on its own: it averages 170 s and peaks at 271 s in
Stateless tests (amd_asan_ubsan, distributed plan, parallel)on master, and the flaky check of this PR failed all eight runs withTest runs too long (> 180s). The slow part is not the cache clearing but the hundred separateclickhouse-clientprocesses - locally the loop of 100 client invocations takes 5 s while the same 100 statements sent through a single connection take 0.075 s. The clearing queries now go through a single connection, repeated for as long as theINSERTis running, so the race is exercised over the whole lifetime of theINSERT. The test takes 1.6 s instead of 6 s locally.Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/118391]