Skip to content

CI: "Build profile diff" is green when the read-only CI logs cluster rejects the readiness probe for load - #128067

Merged
alexey-milovidov merged 1 commit into
masterfrom
ci-log-cluster-probe-classify
Oct 28, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
ci-log-cluster-probe-classify

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Related: #120462
Related: #127912

Build profile diff has been ERROR in practically every PR since 2026-10-26 18:19 UTC: 529 of the runs in CI DB fail with LogClusterNotReady: the endpoint never became ready (example: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127912&sha=0ecac9e802642ebf566075f5145796c9db1fde22&name_0=PR&name_1=Build%20profile%20diff).

The cause is the read-only sub-service of the CI logs cluster (LogCluster.READONLY_URL). It answers every query, including the SELECT 1 readiness probe, and even before authentication, with:

Code: 241. DB::Exception: (total) memory limit exceeded: would use 213.20 GiB (attempt to allocate chunk of 0.00 B), current RSS: 213.20 GiB, ..., maximum: 212.40 GiB. (MEMORY_LIMIT_EXCEEDED)

The replica itself needs a restart. That is an infrastructure action outside this repository.

The job already treats Code 241 as an outage of the shared cluster: select classifies it as LogClusterUnavailable, and the check completes green. But is_ready discarded the probe's answer (and logged only No connection to LogCluster), so a read that never got past the probe ended as LogClusterNotReady, which fails closed.

With this change, is_ready logs the status and body of a failed probe. When the server itself answered (the X-ClickHouse-Exception-Code header is present), it keeps the answer's classification. If no POST was attempted and the last probe was rejected for the server's own load (202, 241), select raises LogClusterUnavailable. A missing secret, no connection, a gateway answer (all of which also describe a wrong or deleted endpoint in AWS SSM), or any other exception code (516 for a rotated password) still raise LogClusterNotReady.

Checked with a throwaway script: the live read-only endpoint now gives LogClusterUnavailable. Mocked 202 gives LogClusterUnavailable. Mocked 516, header-less 502, and a connection error give LogClusterNotReady.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/128067]

Version info

  • Merged into: 26.11.1.876-master (included in 26.11 and later)

…cts the readiness probe for load

Since 2026-10-26 18:19 UTC the read-only sub-service of the CI logs cluster
answers every query, including the `SELECT 1` readiness probe and before
authentication, with `Code: 241` (`(total) memory limit exceeded: would use
213.20 GiB ... maximum: 212.40 GiB`). `select` classifies 241 as
`LogClusterUnavailable` (green check), but `is_ready` threw the answer away,
so every read ended with `LogClusterNotReady` and the check was ERROR in
practically every PR.

`is_ready` now logs the status and body of a failed probe and, when the
server itself answered (the `X-ClickHouse-Exception-Code` header is present),
keeps its classification. If no POST was attempted and the last probe was
rejected for load (202, 241), `select` raises `LogClusterUnavailable`. A
missing secret, no connection, a gateway answer, or any other exception code
(516 for a rotated password) still raise `LogClusterNotReady`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127912&sha=0ecac9e802642ebf566075f5145796c9db1fde22&name_0=PR&name_1=Build%20profile%20diff
Related: #127912

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4e5129b]

Summary: ✅


AI Review

Summary

The PR classifies readiness probes rejected with server load errors (202 or 241) as LogClusterUnavailable, allowing Build profile diff to complete green during these outages. Other readiness failures retain LogClusterNotReady. No actionable findings at commit 4e5129b7938373a112f0cd5f16a07a857b4f1e05; 13 focused mocked test methods passed.

Final Verdict

Status: ✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 28, 2026
@alexey-milovidov
alexey-milovidov marked this pull request as ready for review October 28, 2026 15:23
@alexey-milovidov alexey-milovidov self-assigned this Oct 28, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to do it...

@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Oct 28, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 28, 2026
Merged via the queue into master with commit 183951a Oct 28, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the ci-log-cluster-probe-classify branch October 28, 2026 22:27
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 28, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 31, 2026
…answer

Resolve the conflicts with 4e5129b (ClickHouse#128067) and 1087a07:

- log_cluster.py: master now keeps the classified server answer of a failed
  readiness probe in `probe_error`. The transport exception of a probe that
  got no response at all is stored in that same attribute instead of a
  separate `_probe_error`; `select` only acts on a LogClusterUnavailable
  there, so the read path is unchanged.
- build_profile_hook.py: keep master's artifact list (no symbols upload for
  objects-only builds) and add the LogClusterUnavailable warning branch
  after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
qoega pushed a commit to qoega/ClickHouse that referenced this pull request Nov 19, 2026
… logs cluster outage

When the read-only sub-service of the CI logs cluster stops answering,
every `SELECT 1` readiness probe of `LogCluster.select` raises
`requests.exceptions.ReadTimeout`. `is_ready` turned that into a bare
False without a `probe_error`, so `select` raised `LogClusterNotReady`,
which `build_profile_diff_job.main` does not catch, and the check went
red on unrelated PRs (8 of them on 2026-11-06 between 00:00Z and 02:52Z,
e.g. job 127646247697 of ClickHouse#129611). The same outage hitting a POST already
ends `LogClusterUnavailable` (ClickHouse#121048), and so does a probe the server
rejects with 241 (ClickHouse#128067).

A probe that raises `ReadTimeout` now records `LogClusterUnavailable` in
`probe_error`, and the tail added by ClickHouse#128067 reports the read green as
"the endpoint never became ready: the readiness probe timed out: ...".
The last probe decides, as there.

A `ReadTimeout` (requests 2.33.0, the CI pin) is raised only after the
name resolved and a server accepted the connection: a stalled TLS
handshake or a stalled answer. Connection refused, an unresolvable name,
no SYN-ACK and a certificate mismatch raise `ConnectionError`
(`ConnectTimeout` and `SSLError` are subclasses), and the server itself
rejects a rotated password with 516. All of those, a missing secret and
a gateway answer still end `LogClusterNotReady`, as ruled on ClickHouse#120288.

This is the `SELECT 1`-timeout leg left open on ClickHouse#121048. Validated with
a throwaway harness against master (real sockets, mocked transport and
`main()` end to end); only the probe-timeout cases change. No test is
committed for the CI scripts (ClickHouse#119766).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants