Repository navigation
Fix flaky test 02813_starting_in_text_log under TSan - #100566
Closed
alexey-milovidov wants to merge 7 commits into
Closed
alexey-milovidov wants to merge 7 commits into
alexey-milovidov wants to merge 7 commits into
Conversation
The test scans `system.text_log` which can be very large. Under TSan with randomized `max_threads 1`, the query is estimated to exceed the default `max_execution_time` of 600 seconds, causing a `TOO_SLOW` exception. Disable the execution time limit for this query. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100410&sha=a0736de7dab173981f7d5bb43db1e8d909b50d13&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20parallel%2C%202%2F2%29 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [784b876] Summary: ❌
AI ReviewSummaryThis PR narrows ClickHouse Rules
Final Verdict
|
Algunenano
reviewed
Mar 24, 2026
Algunenano
left a comment
Member
There was a problem hiding this comment.
The query looks really suboptimal and it's not doing what's supposed to be doing:
- The filter matches itself, so if you execute the query once it will find itself and pass the test.
- It reads a huge amount of rows, but it only needs to find the single entry at the startup; LIMIT 1 would be enough.
- We could even narrow it down using
uptime+- 10 minutes.
1 task
Member
|
Fixing it in #100724 |
Use `LIMIT 1` instead of `count()` to avoid scanning the entire table. Narrow the time range using `uptime` to find the startup message near the actual server start, avoiding false matches from the query itself. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Use a ±10 minute window around startup time instead of an open-ended lower bound, and filter by `logger_name = 'Application'` to avoid matching unrelated log entries. This makes the query much more efficient and precise. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.
The test scans
system.text_logwhich can be very large. Under TSan with randomizedmax_threads 1, the query is estimated to exceed the defaultmax_execution_timeof 600 seconds, causing aTOO_SLOWexception. Disable the execution time limit for this query.Fixes #100525
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100410&sha=a0736de7dab173981f7d5bb43db1e8d909b50d13&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20parallel%2C%202%2F2%29
#100410
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes