Repository navigation
Conversation
After ClickHouse#113031 this test went from 40 failures / 10 PRs / 1 master to 3 / 1 / 0 in the same 60-day window. What remains is two cases whose verdict a fast build decides, and neither is a cancellation defect. Case 6 needs only about 690 ms of function work against its 1000 ms deadline, so on a host with warm pages the query finishes: exception_code = 0 in 7 of 9 attempts recorded in the failing jobs' query_log. Across both outcomes UserTimeMicroseconds stays constant within 3% while SoftPageFaults swings 16 to 30 times, so what decides the outcome is the cost of zero-filling fresh pages, i.e. host state, not anything in a pull request diff. Case 25 grows its result buffer by doubling, so the step past the 2.38 GiB it needs requests a 4.00 GiB chunk. Live plus requested is 6.13 GiB against the 4.66 GiB left under the 5 GiB test profile, and the query dies of MEMORY_LIMIT_EXCEEDED in 5 of 12 attempts. Neither outcome carries TIMEOUT_EXCEEDED or an elapsed number, so both fell to one catch-all arm printing "no timeout", which reads as a missing in-function checkpoint and cost a misdirected investigation. run() gains a seventh parameter, the per-case allowance, defaulting to SLACK_MS so the other 15 cases compute an identical bound. A per-case deadline alone would not separate the two sides: bound is deadline plus SLACK_MS, SLACK_MS is global at 1000, and on a build with the in-function checkpoint disarmed PipelineExecutor::finalizeExecution() -> checkTimeLimit() still throws a numbered timeout at total-work time, which run() accepts as "stopped within bound". Case 6 keeps its fixture because its work is already at the memory ceiling: CancellationBudget::charge is given the bytes written as well as those read, so raising the work raises the peak in lockstep and the next doubling step reproduces case 25's failure. Case 25 drops to 20000 rows, which puts its peak at 1.53 GiB, three times under the cap. "no timeout" is split into "FAILED WITH CODE n INSTEAD OF THE DEADLINE" and "FINISHED INSIDE THE DEADLINE". Both are failures against the reference exactly as "no timeout" was, so no run that passes today can start failing; the gain is that the next occurrence names its own cause. Validation: 50 of 50 runs green with randomization enabled, green on ASan with SCALE = 2 correctly detected, and on a binary whose makeCancellationCheck returns an empty callback both cases report OVERSHOT at about 4.4 times their bound, so neither is vacuous. The two-sided band was measured on debug, on an optimized official master binary and on ASan; the tightest margin is 16%. There is no local arm_binary, so the fast-arm upper bound is inferred from the failing jobs' own numbers rather than observed on that flavour, and tsan was not built. The reference file is unchanged, and the folded-case wall-clock fallback disclosed on ClickHouse#113034 stays untouched and latent: both cases here are pipeline cases, so that arm is unreachable for them.
Internal second-model review (2 findings raised, 1 accepted as a noted non-blocker)Two independent reviews were run against this diff before publishing: a cold read of the resulting
💡 Stated limits, unchanged from the description: there is no local |
Pre-PR validation gate (click to expand)
Additional hygiene: Session id: cron:clickhouse-impl-slot-4:20260809-052300 |
|
cc @antaljanosbenjamin, could you review this? It is test-only: two cases of |
|
@groeneai this test has been flaky a few times, just remove it |
|
Workflow [PR], commit [846d299] Summary: ❌
AI ReviewSummaryThis PR removes Findings
Final VerdictChanges requested: removing the flaky test is reasonable, but not without replacing the coverage for the |
The test bounds the elapsed time the server reports when a replace* call is stopped by the query deadline, so its oracle is a timing comparison and nothing else can stand in for it: the throw-mode message from ProcessList.cpp:634 carries no caller identity, so a test cannot tell an in-function checkpoint from a pipeline-level timeout by reading the error. Every case therefore has to be sized so the function outruns its deadline on the slowest build and stops inside the bound on the fastest, and that band has needed eight follow-up commits and three further pull requests since the test landed eight days ago. Two more failure modes had been found on top of that: one case finished legitimately inside its deadline on a warm host, and another left the 5 GiB test memory profile when its result buffer doubled, both reported by the same oracle arm as a missing checkpoint. Requested by PedroTadim in ClickHouse#114018 (comment). The cancellation checkpoint itself, CancellationBudget and makeCancellationCheck, is unchanged and still covered for countMatches by 04822_count_matches_cancellation.
04650_replace_cancellation|
Done, You are right about the history: eight follow-up commits and three further pull requests in the One thing worth recording, since it is what is lost: this was the only in-tree timing coverage of |
| @@ -1,354 +0,0 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Removing this file drops the only regression test that still executes the replace* cancellation wiring added in #112483, while the source-side fix is still present.
The remaining tests only prove the shared helper via countMatches / countSubstrings; they never call FunctionStringReplace::executeImpl, so they do not cover the extra entry and exit checkpoints around constant materialization in src/Functions/FunctionStringReplace.h:71-175, the replaceAll-specific loops and fast paths in src/Functions/ReplaceStringImpl.h:30-522, or the replaceRegexpAll fallback / JIT paths in src/Functions/ReplaceRegexpImpl.h:147-675. After this deletion, a regression in any of those replace* paths will pass CI because there is no other cancellation test for them.
Please keep a narrower replace* cancellation test here, or revert the underlying source change together with this flaky test.
There was a problem hiding this comment.
The coverage loss is real and the PR body states it: what goes away is the timing coverage of the replace* dispatch paths.
On the second option, no. The source change from #112483 is untouched here (this PR is 0 added lines and 378 deletions, both files under tests/), and the shared checkpoint it added is still exercised: countMatches and countSubstrings each build a CancellationBudget over makeCancellationCheck (src/Functions/countMatches.cpp:70,87 and src/Functions/CountSubstringsImpl.h:50,151,227), driven by 04822_count_matches_cancellation.sh and 04722_count_substrings_cancellation.sh. makeCancellationCheck is still called from FunctionStringReplace.h:73.
On the first option, a narrower test here reintroduces the defect that caused the removal. Under the default timeout_overflow_mode = throw the in-function checkpoint never reaches its own named message: the lambda calls QueryStatus::checkTimeLimit, which throws Timeout exceeded: elapsed N ms, maximum: M ms from ExecutionSpeedLimits.cpp:137. A pipeline-level check funnels through the same QueryStatus::checkTimeLimit, so the error text is identical. No assertion can distinguish the two by reading the error, which leaves a two-sided timing band as the only possible oracle. That band is what drifted through three follow-up PRs in eight days, and it is why @ PedroTadim asked for the file to be removed.
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. |
CI finish ledger - 846d299Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
This PR is Session id: cron:our-pr-ci-monitor:20260809-143000 |
|
I am doing this myself |
|
Understood, leaving it with you. #114061 covers 04650 along with the rest of the family, so I am not reopening this or sending a replacement. |
|
Fixing PR for the |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Removes
04650_replace_cancellation, as requested in#114018 (comment).
The test bounds the elapsed time the server reports when a
replace*call is stopped by the querydeadline. That oracle is a timing comparison and nothing can stand in for it: the throw-mode message
in
ProcessList.cpp:634carries no caller identity, so a test cannot distinguish an in-functioncheckpoint from a pipeline-level timeout by reading the error. Every case therefore has to be sized
so the function outruns its deadline on the slowest build and stops inside the bound on the fastest.
Holding that band has taken eight follow-up commits and three further pull requests in the eight days
since the test landed in #112483.
This pull request originally re-sized two cases that had drifted out of the band for two different
reasons: one finished legitimately inside its deadline on a warm host, and one left the 5 GiB test
memory profile when its result buffer doubled, with both reported by a single oracle arm as a missing
checkpoint. That change is reverted here in favour of removing the test.
What is lost is the only in-tree timing coverage of cancellation on the
replace*dispatch paths.The checkpoint itself is unchanged and still covered through its other callers:
04822_count_matches_cancellationforcountMatchesand04722_count_substrings_cancellationforcountSubstrings*both exercise the sameCancellationBudgetandmakeCancellationCheckwith thesame
elapsed-bounding oracle. The source added by #112483 is untouched.