Repository navigation
Conversation
stress_runner.sh:356 was `start_server 10 600 || { echo ...; exit 1; }`. That explicit exit
terminates the run, and every step that reads the stress phase's own logs comes after it:
:358 check_server_start, :368 check_logs_for_critical_errors, :372 collect_query_and_trace_logs.
The consequential one is check_logs_for_critical_errors (stress_tests.lib:404-430). It is the only
scan carrying the two data-loss detectors (`Code: 499 ... The specified key does not exist` over
clickhouse-server*.log, and `it is lost forever` with SharedMergeTreePartCheckThread) and
`dmesg -T > /test_output/dmesg.log`. Fatal-level detection is not affected: stress_job.py:379-393
greps the same glob from the Python side for `<Fatal>` and for signal 9, on this path too. Neither
restored grep needs a running server: both read /var/log/clickhouse-server/clickhouse-server*.log,
and the stress log was already renamed into that glob at :343. dmesg needs no server at all.
CIDB, 30 days, stress jobs, test_name = 'Cannot start clickhouse-server': the string
`after 11 start attempts` identifies this call site uniquely, because max_attempt=${1:-6} and only
this caller passes 10. It has 199 rows over 158 distinct pull_request_number values, 22 of them on
true master, spread across 12 stress flavours. All 199 discarded the scan, and with it dmesg.log:
a successful arm_tsan run publishes that file, a run that failed this way publishes no dmesg.log at
all. The server logs themselves are still uploaded on this path, because process_results attaches
every file in the mounted server-log directory (stress_job.py:213-216), so the stress phase's log
ships as clickhouse-server.stress.log; only the :369 rename to clickhouse-server.final.log is
skipped.
Losing dmesg.log also disables a policy the job already has. stress_job.py:372-377 computes is_oom
from that file and :486-488 turns an OOM-attributed failure into OK. Without the file the classifier
keeps only its server-log input, which fires exclusively when the server's own child was signal-9'd,
so a container-cgroup OOM that killed any other process is invisible and the job reads as a
ClickHouse failure.
Why `if ! ...; then` rather than `|| { ...; }`: the block now runs several statements and ends in
`exit 1`, and the `if` form keeps start_server's non-zero return from tripping errexit exactly as the
`||` form did. Why `||:` on the call: on the failure path a collection error must not replace the
failure the job is reporting, and it keeps errexit suspended for the whole function body, so one
failing collection step cannot skip the rest. Measured: with a failure injected before `dmesg -T` in
a copy of the lib, dmesg.log is still written with the `||:` and absent without it.
check_server_start is deliberately not added here, because on this path the server did not start and
it would emit a false `Server failed to start` duplicate of the row already reported.
collect_query_and_trace_logs is not added either, because it runs clickhouse-local through the same
config whose object-storage disk is unreachable in exactly this scenario, so it could hang and turn a
fast red into a job timeout. That leaves query_log, trace_log, metric_log and
aggregated_zookeeper_log missing on this path, deliberately. The three earlier start_server sites
report `after 7 start attempts`, 10 rows / 1 PR in the same 30 days, and are left alone.
Validated in the real clickhouse/stateless-test image against the real stress_tests.lib, with the
region executed verbatim out of the script and only the server faked: without the change only the
start-failure row appears and dmesg.log is absent; with it both detector rows and both artifacts
appear while the start failure is still reported; a clean log yields the `No lost s3 keys` and
`No SharedMergeTree lost forever` OK variants, so nothing is manufactured; deleting the restored call
reverts rows and artifacts exactly to master's; the success path is identical on both trees for a
server that comes up on attempt 1 and on attempt 3. The restored scan costs 3.7 s on a 5.0 GiB /
33.2 M-line log, of which 1.6 s is s3_key_lifecycle.py in its worst case.
Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus two independent cold
Also checked and found sound, so not raised: the Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20260920-015700 |
|
Workflow [PR], commit [d8d2fdd] Summary: ❌
AI ReviewSummaryThis PR restores the post-stress log scan on the failed final-restart path by calling Findings
Final VerdictChanges requested: avoid turning failed post-stress restarts into |
| start_server 10 600 || { echo "Failed to start server"; exit 1; } | ||
| if ! start_server 10 600; then | ||
| echo "Failed to start server" | ||
| check_logs_for_critical_errors ||: |
There was a problem hiding this comment.
Restoring check_logs_for_critical_errors here also restores /test_output/dmesg.log, and that is not a pure artifact change. In ci/jobs/stress_job.py:372-488, any OOM marker in dmesg.log sets is_oom = True and then force-sets the whole job to OK, even if test_results.tsv now contains Cannot start clickhouse-server, S3_ERROR No such key thrown, or Lost forever for SharedMergeTree.
That means this failed-restart path can still disappear behind a green check whenever the same run also logged an unrelated kernel OOM. If the goal is to recover these diagnostics, the dmesg.log collection here needs to be decoupled from the broad OOM override, or the override needs to be tightened so these explicit restart/data-loss failures stay red.
There was a problem hiding this comment.
Mechanism confirmed: stress_job.py:372-376 feeds dmesg.log into is_oom, and :486-488 then forces the whole job to OK. The description flags that consequence up front, and it is a fork rather than an oversight: the job's existing policy treats a kernel OOM as not a ClickHouse failure, while this finding says a run that produced no test signal must stay red. Three measurements (play.clickhouse.com, check_name LIKE 'Stress test%', 90 days):
- Restoring
dmesg.logwidens the input, it does not open the channel::380-384already setsis_oomfrom<Fatal> Application: Child process was terminated by signal 9over/var/log/clickhouse-server/clickhouse-server*.log, mounted at:194and populated here (stress_runner.sh:343renames the stress log into that glob before the restart). - That channel has never masked this row:
test_name = 'Cannot start clickhouse-server'in stress jobs is 1249 rows over 1155 commits, every one withcheck_status = failure. - The suggested tightening would have changed nothing observed: of the 169 runs the allowance converted to
OK(0.055% of 308373), 0 carryCannot start clickhouse-server,S3_ERROR No such key thrownorLost forever for SharedMergeTree. What it masks isPossible deadlock on shutdown(104),Hung check failed(40),Server unresponsive: memory limit exceeded(32) and signal-9 rows, the family it was written for.
One caveat against my own numbers: 0.055% is not an independent rate on this path, since container memory pressure plausibly causes both the kernel OOM and the dead emulator that fails the restart, and that correlated case is the one worth ruling on. It is job-level classification for every stress flavour, so I would rather not decide it myself: the guard is two lines at :486 (skip the override when one of those rows is present), and I will add it here if that is the call.
CI finish ledger - d8d2fddEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20260920-160237 |
|
Fixing PR for the STID 3833-2f1a |
…f its outputs narrowPipe glues independent streams behind a ConcatProcessor to keep the number of open sources down. A ConcatProcessor demands its inputs strictly one at a time: it calls setNeeded() on the current input only, and advances when that input finishes. A ScatterByPartitionTransform has the opposite requirement: pushOutputChunks() leaves all_outputs_processed false for any non-finished output with a non-empty share whose canPush() is false, and prepare() then returns PortFull, so the scatter cannot take its next chunk until every output has accepted a share of the current one. Put one above the other and they deadlock. The lanes feeding the Concat's later inputs are never demanded, so their prepare() is never called at all (state NotStarted); the scatter cannot push those shares and parks in PortFull, where it can neither pull nor finish; so the lane the Concat is waiting on never finishes either, and the Concat never advances to the next input. PipelineExecutor::finalizeExecution then throws Pipeline stuck. This is reachable without any unusual setting beyond the join algorithm: ReadFromMerge::readFromMerge narrows the streams of the tables it reads, so a Merge table or merge() over a view whose body contains a sharded merge join hits it, and max_streams_for_union_step reaches it through UnionStep. A window function with PARTITION BY builds the same fan-out, though the Resize the window step places above it keeps that path awake in practice. Decline to narrow such a pipe. narrowPipe returns early when any processor in the pipe answers the new IProcessor::requiresAllOutputsPushable(), overridden by the three processors carrying that contract: ScatterByPartitionTransform, CopyTransform (the GROUPING SETS copier, with byte-identical accounting in prepareGenerate) and ForkProcessor (identical accounting, no users today, so the override states the contract). ResizeProcessor moves data between any ready pair and has no such contract. Narrowing is a memory and file-handle optimization, never a correctness requirement, and both call sites already suppress it conditionally (should_not_narrow in StorageMerge, allow_narrowing in UnionStep), so this is a third reason in the shape the code already has; the pipeline simply stays wide, which is what the same query already gets when either existing suppression fires. Buffering the un-pushable shares inside the scatter was rejected as unbounded memory, the design already refused for the BufferedShardByHashTransform family; making Concat demand all of its inputs would delete the optimization it exists for. The comment in optimizeJoinByShards that excluded the full-sort path from this deadlock class is corrected: the drain it relies on only helps a lane that some consumer has already demanded. Found by CI on ClickHouse#121125, Stress test (amd_debug) at commit d8d2fdd. Co-Authored-By: Claude Opus 5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
In 30 days 199 stress jobs (158 PRs, 22 on true master, 12 flavours) failed their post-stress
restart.
stress_runner.sh:356wasstart_server 10 600 || { echo ...; exit 1; }; that explicitexit 1precedes:368 check_logs_for_critical_errors, so on all 199 theS3_ERROR No such key thrownandLost forever for SharedMergeTreedetectors anddmesg -T > /test_output/dmesg.lognever ran.
<Fatal>and signal-9 detection is unaffected:stress_job.py:379-393greps the samelogs. What is lost is those two data-loss detectors and
dmesg.log. Both greps readclickhouse-server*.log(renamed there at:343), so neither needs a server.It goes in this caller, not
start_server: the function is an end-of-run step, and:356is theonly such site.
One behavioural consequence, up front.
dmesg.logis the kernel-side input to this job's OOMclassifier (
stress_job.py:372-377), and:486-488already turns an OOM-attributed failure intoOK. It is inoperative on this path today, so restoring it will make some currently-red stress jobsread as OK; its grep matches any container process, not only the server. If they should stay red
instead, that is a small classifier change I can make here; your call.
collect_query_and_trace_logsstays out: it drivesclickhouse-localthrough the same unreachableobject storage, so
query_log/trace_log/metric_logstay missing. The three earlierstart_serversites (after 7 start attempts: 10 rows / 1 PR) andupgrade_runner.share unchanged.Validated in the real CI image against the real
stress_tests.lib: master emits only thestart-failure row and no
dmesg.log; the patch adds both detector rows and the artifact, stillreporting the start failure; deleting the call reverts the result exactly. 3.7 s on a 5 GiB log. In
the reported run the scan would have found nothing; the defect is that it runs on none of the 199.
Related: #119808
Provenance:
Stress test (arm_tsan)on PR #110105 @0da1b2081(report).
Workflow [PR]
Sync PR [sync-upstream/pr/121125]