Repository navigation
Backport #108810 to 26.6: Fix segfault in StreamingStorageRegistry - #109173
Conversation
|
Workflow [BackportPR], commit [61d63a9] Summary: ✅ |
|
🕵 @groeneai, investigate the failure: https://github.com/ClickHouse/ClickHouse/actions/runs/33922619574/job/101188237791 and provide a fix in a separate PR. If the fix is already in progress, link it here. The job |
|
Investigated. Two separate failures here, and neither is caused by this backport. 1. This tree reproduces the signature. Five of the six old-analyzer shards uploaded results (768 to 1126 test rows each); #117412 and #117202 cannot be the fix on this branch: 26.6 starts the integration runner with One free item that is new since 08-31: #117564 is merged on master, and 2. On this tree the The 26.8 failures you cite are real and separate: 26 failures over 16 trees in 45 days, every one on Two controls:
The 26.8-vs-26.7 delta for this module is 7 commits, and two of them are mine. #113992 (merged 2026-08-19) rewrote the old-leader read path of So I am treating my own #113992 as the prime suspect rather than the test being generically flaky. That is a suspect and not yet a proven cause, so I am not sending a speculative change: a fix task is created, and I will post the fixing-PR link here when it opens. |
|
🕵 Thanks for the investigation. Agreed that neither failure is caused by this backport (a null check in |
|
Fix: #118297. Two corrections to what I posted earlier in this thread, both of which my own measurements refuted:
What it actually is: the module registers 18 long-lived servers, the heaviest of the shard's 258 test files, inside a job capped at 59.77 GiB running It reduces this module's demand rather than closing the shard's 7200 s overrun, and it does not need a CI-config change. #116591 raising the release-branch set from 4 to 6 batches landed after the 26.8 cut, so 26.8 does not have it; whether to backport that, and whether to label this PR for 26.8, are your call. |
_wait_serving_requests retried keeper_utils.wait_until_connected on a refused connect until its own deadline, but let the helper's 30 s default bound the wait for the "This instance is not currently serving requests" answer. That answer is not startup-only: MonitorCommand returns it whenever KeeperDispatcher is not active, which is checkInit() && hasLeader() && !isRecovering(), so a cluster that has not elected a leader yet gives it. The helper raises a plain Exception there rather than an OSError, so the retry loop did not cover it either, and a phase needing more than 30 s to settle failed although its caller allowed 180 s and the leadership wait right after it allows 180 s of its own and drives the election with rqld. Measured against the previous commit with a stub keeper_utils: given a 3 s caller budget the not-serving wait ran 30.1 s and raised "30.0s timeout", so the caller's budget was ignored in both directions. With the remaining budget threaded through, that case ends at 3.0 s, the refused-connect retry still stops at the caller's deadline, and the budget handed down shrinks across retries (180.0, 179.5, 179.0). An ASan run of the module logs timeout=179.999998 for the phase waits while the module's own direct wait_until_connected calls keep the 30 s default. Reported by the AI review on the pull request. Related: ClickHouse#109173 Co-Authored-By: Claude Opus 5 <[email protected]>
…unked_transfer
test.py registers 18 long-lived servers (six independent 3-node Keeper
clusters) and test_concurrent.py another 10. They are the two heaviest of
the 258 test files on Integration tests (amd_asan_ubsan, db disk, 2/4)
(214 modules, 444 servers in total); the next heaviest single file
registers 8. The job's runner container is capped at 59.77 GiB and runs
pytest -n 3 --dist=loadfile, so a single xdist worker holds an entire
cluster; when the co-workers also hold heavy modules the runner's memory
killer takes the worker down and the dead containers surface as
connect-refused, RST or "Cannot start ClickHouse" in whichever test was
running. The module fails 26 times in 758 runs of that check on 26.8
against 0 in 825 on 26.7.
An idle sanitizer server costs about as much resident memory as a busy
one. Every instance stays registered, so coverage is unchanged, and only
one group of clusters stays running: the local-disk and S3 pair that
share a snapshot chunk setting, two of the six. Rotating per cluster
instead of per group would stop three more sanitizer servers but raise
cluster restarts from 2 to 7 at this parameter order, and this shard
already overruns its 7200 s session timeout. use_keeper_phase recomputes
the wanted state from each container's live process state on every call
rather than remembering the previous phase: every test here stops a node
mid-test and restarts it later, so a test that fails in between leaves a
node of the current phase down and the next test needs it back.
Two properties the module previously got for free from cluster.start()
have to be re-established after a restart, and both were found by
observing the failures rather than by reading the code:
- a phase's servers must come up together. A Keeper server started on
its own waits out keeper_server.startup_timeout (180 s) for a quorum
only its peers can form, while start_clickhouse blocks on readiness,
so the starts run concurrently.
- a cluster's first server must hold leadership. It has the top
priority and the others start as followers, and no test kills it, so
pinning leadership there (via the rqld four-letter command) keeps a
test's kill of a lagging node from removing the leader; a
re-election drops the writes then in flight and surfaced as
kazoo ConnectionLoss inside fill_test_tree.
The four servers running a pinned release are excluded from the rotation
and stay up for the whole module: a release Keeper aborts at startup on a
snapshot written by the newer server it is clustered with ("Unsupported
snapshot version", "Manual intervention is necessary for recovery"), so
restarting one is unrecoverable. They are also the only non-sanitizer
servers here, at 0.16-0.27 GiB each against 1.4-3.0 GiB.
Measured locally on one ASAN build (master d1adb9f, build id
05FA8FDC83C1C7051AA42F9DC4EDAA98B469E4B0), sampling docker stats over the
module's containers: peak sum of container working set falls from
26.21 GiB to 13.29-14.18 GiB over six green runs and sustained concurrent
servers from 18 to 10, for +17% module wall clock (492 s to ~575 s
median). Both arms ran on that one binary; the before arm was re-measured
after the shared build snapshot was refreshed mid-campaign, so the
comparison is not across binaries. The 18-server spike at cluster.start()
itself is unchanged, because add_instance has no deferred-start knob and
cluster.start() cannot start a subset; what goes away is sustained
residency, which is where the peak actually occurred.
Related: ClickHouse#109173
Co-Authored-By: Claude Opus 5 <[email protected]>
Original pull-request #108810
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.6.5.54