Repository navigation
Remove recently added cancellation tests, they are flaky - #114061
Conversation
|
Workflow [PR], commit [d5bc955] Summary: ❌
AI ReviewSummaryThis PR removes seven recently added stateless regression suites that were the only focused coverage I could find for several cancellation contracts: in-function deadline handling in Missing context / blind spots
Findings
Final Verdict
|
|
I wrote these seven tests, and I agree with removing them. Measured over the last 30 days, excluding flaky-check jobs, they produced 76 failures across 42 pull requests, 26 of them by other authors, plus 3 master runs. The two worst are One correction to what I argued on #113943. I attributed the The AI review here asks you to keep replacement coverage. I am not asking for that. If you want a guard for any of these contracts later, tell me the shape you would accept and I will write it then. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 3 s compile time in total, 6 of them have a recent master baseline. |
`countSubstringsCaseInsensitiveUTF8` ignored `max_execution_time` and `KILL QUERY` for the duration of one substring search: a one-second deadline was observed after 13.4 s, and `KILL QUERY SYNC` blocked 53 s on a 400 MB value. The checkpoint added in ClickHouse#113369 is charged between searches, and `vectorConstant` searches a whole block in one call, so many ordinary rows in which the needle does not occur reproduce it as readily as one large value. Nothing under `src/Common` checked cancellation, and one searcher is slow enough to matter: on that shape the case-sensitive scan takes 0.19 s and the ASCII case-insensitive one 0.77 s, while `UTF8CaseInsensitiveStringSearcher` takes 13.6 s, folding a code point at a time through `Poco::Unicode::toLower`. The scanning loops now take an optional charger callback, modelled on the one `encodeBase58` already takes, and `CountSubstringsImpl` binds one to the `CancellationBudget` it builds per call. Three properties are load-bearing: comparison work is charged rather than distance covered, since a candidate can walk the whole needle before failing; the accumulator lives in the caller, because `vectorVector` builds a searcher per row; and both build paths carry it, since `Volnitsky.h` gates `use_fallback_searcher` on `__AVX2__`. A caller passing no charger gets its own instantiation of the loop and pays nothing. Realigning after a skipped window is itself a loop over a continuation run that can span the haystack, so it is bounded per iteration; stopping mid-run is safe because a continuation byte begins no match. No returned value changes: the range passed to `search` is untouched, so no chunk edge exists. The test asserts results rather than latency. Charging runs on the matching path, so it can drop, duplicate or misplace an occurrence, and that is observable without a clock: all three functions over both dispatch branches, start positions, empty haystack and needle, folding between code points whose lowercase differs in byte length, and five cases in which a run of continuation bytes long enough to skip a whole window is followed by a match that must still be found. Each of those five is paired with the case-sensitive count as an oracle that does not go through this searcher, and advancing one byte past the realignment changes all five and none of the others. An earlier revision bounded elapsed time instead. It failed 22 CI runs out of 22: on the thread sanitizer the machine is about ten times slower, three arms overran, and the control meant to finish well under a one-second deadline took 12027 ms, leaking its TIMEOUT_EXCEEDED into the server log. No bound survives the build matrix, since one high enough for the sanitizer sits above the unfixed side on release. ClickHouse#114061 removes seven earlier tests of that shape for the same reason. Cancellation promptness is therefore left unpinned. `position*` and `multiSearch*` share the defect and each needs its own call site. `compareTrivialUTF8` folds a whole needle with no checkpoint, so a needle differing only at its last code point still overruns by a bounded 0.85-1.02 s; that fix belongs inside that function, shared with `startsWith`/`endsWith` and `VolnitskyBase::compare`. Related: ClickHouse#112203 Related: ClickHouse#113369
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Version info
26.8.1.1071(included in26.8and later)