Repository navigation
Fix flaky test 05339_filelog_shared_watch_thread - #131241
alexey-milovidov merged 1 commit into
Conversation
The test compared the server-wide `GlobalThread` metric before and after creating 200 FileLog tables and required a growth below 100. That metric also counts the threads of unrelated, lazily growing pools. In the failing master runs (4a88506, fc8a491, 149b9fa) a background merge of the wide `system.metric_log` table on the `cached_s3` disk grew the threadpool remote-FS reader by 119-163 threads inside the CREATE window, while the CREATEs added about one. Only the DatabaseReplicated lane failed: each CREATE there goes through Keeper, so the window is ~18 s instead of ~1 s. Count the shared watch thread itself: rows of `system.stack_trace` named `FileLogWatch`. There is one reactor per server and `DirectoryWatchReactor::add` waits for its thread, so after the CREATEs the count is 1 whatever else runs on the server. It reads 0 on 26.10, which still has a thread per table. Reading only `thread_name` sends no signals to other threads. Related: ClickHouse#125794 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (2 nits, no change).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261113-093500 |
|
cc @mu-soliman, could you review this? The test now counts the FileLogWatch thread in system.stack_trace instead of the server-wide GlobalThread delta, which a concurrent system.metric_log merge on cached_s3 grew by 119-163 threads inside the ~18 s Replicated-database CREATE window. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20261113-091500 |
|
Workflow [PR], commit [82d32b2] Summary: ✅ AI ReviewSummaryPR #131241 replaces the noisy server-wide Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested; the documented validation supports this focused test correction. |
|
cc @mu-soliman |
c623786
Related: #125794
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
05339_filelog_shared_watch_thread, added by #125794, fails its first line only inStateless tests (arm_binary, s3 storage, DBReplicated, sequential): 14 of about 500 runs since the merge, 3 of them on master (MasterCI, 149b9fac86), 0 failures on every other job.The test required the server-wide
GlobalThreadmetric to grow by less than 100 while it creates 200 FileLog tables. That metric also counts the threads of unrelated pools that grow lazily. In the 3 failing master runs, a merge ofsystem.metric_logon thecached_s3disk started inside that window and the threadpool remote-FS reader took 119-163 new global threads in one second; the CREATEs themselves added about one. The window is ~18 s with a Replicated database (each CREATE goes through Keeper) and ~1 s elsewhere, which is why only that job fails.The test now counts the shared watch thread itself:
system.stack_tracerows namedFileLogWatch. There is one reactor per server andDirectoryWatchReactor::addwaits for its thread, so the count is 1 whatever else runs.Validation (master debug build), on a fresh server with a 256-thread query started inside the CREATE window: the old test fails with the CI diff (
GlobalThread+255), the new one passes under the same load (GlobalThread+256). The new line reads 0 on 26.10, which still has a thread per table. 50/50 randomized runs and 10/10 with a Replicated database pass.Workflow [PR]
Sync PR [sync-upstream/pr/131241]
Version info
26.11.1.2326-master(included in26.11and later)