Repository navigation
Conversation
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding in the full pass,
The delta recheck found nothing. One thing it looked for specifically: finding 1 adds a condition Not changed, deliberately: Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20260908-035200 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20260908-032200 |
|
Workflow [PR], commit [81e3d56] Summary: ❌
AI ReviewSummaryThis PR changes the Findings
Final VerdictStatus: Minimum required action:
LLVM Coverage Report |
|
cc @maxknv @leshikus, could you review this? |
A failure the server raises after it has started writing the result cannot travel in the HTTP status, because the status is already on the wire. It arrives inside the body instead, next to the rows produced before it, under a 200. Reporting that as a failed read is what the previous commit fixed; it also made such a read fail on its first attempt, while LogCluster.select retried a 500 eight times with a growing backoff. The distinction the retry policy needs is not the error code but where the failure was detected. A query the server refuses is rejected before it writes anything, so it comes back with an error status: locally, an unknown table gives 404, and Code 241 raised during aggregation or in a window frame gives 500, which select already retried. What a committed 200 can still carry is a failure that struck mid-query: a timeout mid-stream arrives with 7 rows and Code 159 TIMEOUT_EXCEEDED in the body, and that is exactly the transient class select's own comment is about. So select now takes body_failed, a predicate over a response whose status looks successful, and gives a body that reports a failure the same backoff as a 500. Db.query passes the condition its own raise already used, so the two cannot drift, and an ordinary empty result set stays a successful read on the first attempt: the "no build profile data yet" answer must not cost eight reads. An in-band failure that clears on a later attempt now returns that attempt's rows. Before this commit it failed the job immediately; before the previous one it returned the failed attempt's truncated rows as a complete result. Raised by clickhouse-gh[bot] in review of this pull request: ClickHouse#118708 (comment) Co-Authored-By: Claude Opus 5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
CI finish ledger - 889a353Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
Session id: cron:our-pr-ci-monitor:20260908-113133 |
azat
left a comment
There was a problem hiding this comment.
Please remove all the water from the description, you generated a lot of text, but what we need is the clear reason of this PR instead.
The reason - we want to return the error to the caller to instead of printing it in the select() function itself, but those scripts are very hacky, and I'm not even sure that we need to bother...
And if we do, we need to rely on exceptions instead, so that the caller cannot ignore the error.
|
Superseded. @ alexey-milovidov has ruled to keep #121048 and close this one (#120288 (comment)): the green-on-outage outcome is the one he wants, and two rewrites of the same @azat, you have four review rounds in it and you closed #120121 in its favour, so I am not closing it behind your back: say the word and it is closed. Where your asks stand in #121048:
The |
…e status Address review: `status >= 500` is not "the cluster never answered". The server reports several of its own verdicts on a query as a 500 - 164 for a setting change on a readonly profile, 158 for `max_rows_to_read`, 241 for the memory limit, 395 for a `throwIf` after the result started - so a real defect in one of the `Build profile diff` reads would have reported the check green. `X-ClickHouse-Exception-Code` is the exact discriminator: it is present on every answer the server produced and absent when the answer did not come from it, whatever the status. `LogCluster._classify` keys on it - absent means a gateway, a proxy or a closed connection (`LogClusterUnavailable`); a code in `TRANSIENT_EXCEPTION_CODES` (159, 202, 209, 241) is the shared cluster talking about its own load (`LogClusterUnavailable`); anything else is its verdict on this very query (`LogClusterQueryError`, fail closed, and the same verdict on every retry so it is not retried). 241 in the transient set also closes azat's ask on #118708 in its general form, by the exception code rather than by the coincidence that the status happens to be 500. `raise` on that verdict has to escape the loop, so `except LogClusterError: raise` precedes the generic transport handler; without it the handler catches the verdict and retries it eight times. An endpoint that never became ready is now its own `LogClusterNotReady`, a sibling of `LogClusterError` that `main` does not catch: a readiness probe that never answers is indistinguishable from a rotated password or a deleted SSM parameter, and completing green on that would blank the check fleet-wide for as long as the condition lasts. Neither change affects the outage this pull request is about: those failures never get a response at all (`ReadTimeout`), so they end at "every POST attempt failed with an exception". Related: #118708 Related: #118467 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
`LogCluster._classify` treated exception codes `159` (`TIMEOUT_EXCEEDED`)
and `209` (`SOCKET_TIMEOUT`) as `LogClusterUnavailable`, so they reached
`main`'s green handler in `ci/jobs/build_profile_diff_job.py` and
reported the check `OK`.
Both are the server's verdicts on a query it accepted, not statements
about the shared cluster's load, and `_classify` is reached from `select`
only - `is_ready` posts its own constant `SELECT 1` and returns a bool
without consulting the set, and `do_query` retries on the status. So the
only path the two codes affected is the reporting `SELECT`s, and there a
query that regressed into a server-side timeout was retried eight times,
classified as an outage, and hidden behind a green check - exactly what
the contract of `report_cluster_unavailable` excludes.
They bought nothing for the outage that motivated the green path either:
that shape returns no response at all (`ReadTimeout`), which leaves
through the transport handler and is `LogClusterUnavailable` whatever the
set contains.
`TRANSIENT_EXCEPTION_CODES` is now `{202, 241}` - too many simultaneous
queries, and the server-wide memory-pressure windows - both verdicts
about the cluster's own load, and both observed rather than inferred.
Verified with a throwaway harness (not committed - we have no automated
tests for the CI scripts): `159` and `209` now classify as
`LogClusterQueryError` and raise after exactly one POST, `202` and `241`
still classify as `LogClusterUnavailable` and exhaust the eight retries,
a headerless `502`/`503` is still `LogClusterUnavailable`, a non-numeric
header value still falls closed, and `164`, `158`, `62` and `60` are
unchanged.
Follow-up to ClickHouse#121048,
addressing the review finding left unresolved there.
Related: ClickHouse#121048
Related: ClickHouse#118708
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Related: #115706
Related: #120121
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A failed CI logs cluster read in the
Build profile diffcheck now reports the HTTP status and the server's error instead of being reported as a commit with no build profile data, and a read the cluster could not serve skips the comparison instead of failing the check.Description
The reason: hand the cluster's error to the caller instead of printing it inside
select(), and do not red a commit for a cluster that could not answer the read.selectreturnedNone, soDb.querycould only name the SQL it had sent. It now raisesReadFailurewith the status and the cluster's error; the body check is generic, so no caller passes one in.When every observed failure was the cluster failing to serve the read, it raises
TransientReadFailureinstead and the job isSKIPPEDwith a pinned comment saying the comparison did not run. That covers a>= 500, a timeout, and an error the server reports after already committing an ok status, which is howMEMORY_LIMIT_EXCEEDEDusually arrives. A 403 or any other refusal, a probe answering something other than1, and a comment that did not post all keep the check red. The skip is not cached, so a later run retries. The readiness probe is classified the same way; it used to printNo connection to LogClusterwith neither status nor body.Replaces #120121, closed in favour of this one.
Workflow [PR]
Sync PR [sync-upstream/pr/118708]