Repository navigation
Deflake 04648_geohashes_in_box_cancellation - #112823
Conversation
The two `KILL` cases on reversed and NaN bounds raced a window they could not be given. Rows whose box expands to nothing cost about 11ns each, so the row loop the kill has to land in lasts 650ms for the 60M-row block the cases use in a debug build and around 200ms in a release one, and the block cannot be made longer without being made bigger: it is already 1.25GiB. Against that, the readiness poll runs `curl` and then `clickhouse-client` per iteration, and a single fork stall on a loaded runner is enough to step over the whole window. In the report below the killed query lived from 18.394 to 19.005 while the poll slept between its first iteration at 18.233 and its second at 20.251, so `KILL` was finally issued 32 seconds after the query had already finished. Both cases also compared how long `KILL ... SYNC` blocked against the block run to completion, and that numerator is not only the remaining loop work: it includes tearing 1.25GiB down, which on a fast release build is most of it. Hence `nan kill ran 1190ms of a 1436ms block` on a build that has the fix. So the assertion is removed rather than retuned: an interruptible zero-item loop is not observable from a stateless test at a block size that fits in a CI job. The boxes stay in the liveness checks, which is where they exercise counting a row as a work unit at all. The cases that expand a box keep their assertions - one of those blocks runs for ten seconds or more against a one second deadline, so the cancellation lands inside the row loop whatever the load does, and they still fail on a build without the fix by 11x rather than by the 1.2x the zero-item cases had. The remaining bound was itself the third failure mode, as `float64 throw ran 4419ms past a 1000ms limit` on a loaded sanitizer build: with a checkpoint every million items, over three seconds of that was work already started and not yet interruptible. A checkpoint every 100k items is ~1.2MB of geohashes against a clock read, which keeps the same measurement an order of magnitude inside the bound and is what "cancelled promptly" should mean anyway. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=8aad759007771032aa94d7f4eee3e18103dd63c3&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 Related: #112273 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [3f0e190] Summary: ✅
AI ReviewSummaryThis PR deflakes Findings
Final VerdictChanges requested. |
| # Degenerate rows cross the same checkpoint once every row counts as a work unit, and must still | ||
| # return their documented empty arrays. | ||
| # Reversed and NaN bounds return no items at all, so they cross the same checkpoint only because a | ||
| # row counts as a work unit on its own, and they must still return their documented empty arrays. |
There was a problem hiding this comment.
The new "liveness" query here no longer makes the degenerate/NaN cancellation path observable. geohashesInBoxPrepare returns {} for these inputs (src/Functions/GeoHash.cpp:274-281), so if items_since_check regressed back to prepared_args.items_count the query would still produce the same empty-array result and this check would stay green; with no deadline set, crossing the checkpoint has no visible effect. That means this PR drops the only regression coverage for the "count each row as one work unit" invariant from #112273.
If the stateless KILL oracle is too noisy to keep, we still need another observable check here (for example a focused unit/stress test that cancels through QueryStatusPtr) rather than a pure result-value query.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 4/4 (100.00%) · Uncovered code |
04648_geohashes_in_box_cancellationhas failed 11 times on master and in pull requests over the last four days, in three distinct ways. All of them come from its twoKILLcases on reversed and NaN bounds, plus the fixed millisecond bound the other cases use.Rows whose box expands to nothing cost about 11ns each, so the row loop a kill has to land in lasts 650ms for the 60M-row block those cases use on a debug build and around 200ms on a release one — and the block cannot be made longer without being made bigger, as it already holds 1.25GiB. Against that window the readiness poll runs
curland thenclickhouse-clientper iteration, and one fork stall on a loaded runner steps over it: in the report below the killed query lived from 18.394 to 19.005 while the poll slept between its first iteration at 18.233 and its second at 20.251, soKILLwas issued 32 seconds after the query had finished (nan kill: query never reached the row loop, thenended with code 0 instead of being cancelled, the dominant mode with 5 of the 11).Their oracle was unsound as well. It compared how long
KILL ... SYNCblocked against the same block run to completion, but that numerator also covers tearing 1.25GiB down, which on a fast release build is most of it — hencenan kill ran 1190ms of a 1436ms blockon a build that has the fix.So the assertion is removed rather than retuned: an interruptible zero-item row loop is not observable from a stateless test at a block size that fits in a CI job. Those boxes stay in the liveness checks, where they exercise counting a row as a work unit at all. The cases that expand a box keep their assertions — such a block runs for ten seconds or more against a one second deadline, so the cancellation lands inside the row loop whatever the load does. Verified against a pre-fix binary: they still fail, by 11x (
ran 11423ms past a 1000ms limit) rather than by the 1.2x the zero-item cases had.The remaining bound was the third failure mode,
float64 throw ran 4419ms past a 1000ms limiton a loaded sanitizer build: with a cancellation checkpoint every million items, over three seconds of that was work already started and not yet interruptible. The checkpoint now runs every 100k items — ~1.2MB of geohashes against a clock read — which is what "cancelled promptly" should mean and keeps the measurement an order of magnitude inside the bound.The test also drops from 47s to 6s and from 1.25GiB peak to a few tens of MB.
Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=8aad759007771032aa94d7f4eee3e18103dd63c3&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29
Related: #112273
Changelog category (leave one):
Documentation entry for user-facing changes
🤖 Generated with Claude Code