Skip to content

Perf CI: export the logs of a reference server that died during the tests - #132710

Open
groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:perf-report-dead-server
Open

groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:perf-report-dead-server

Conversation

@groeneai

@groeneai groeneai commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129874

Changelog category (leave one):

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

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The performance comparison now restarts the reference server when it died during the tests, so its logs are exported and the report is built with the run error instead of failing with Errors while building the report.

Description

When the reference (left) server dies during the tests, the performance comparison does not restart it to export its system logs. Its left-*.tsv dumps stay empty, analyze_queries and report fail on them (CANNOT_EXTRACT_TABLE_STRUCTURE ... the file is empty), the job reports Errors while building the report. instead of 1 errors, and Insert historical data fails on the missing all-query-metrics.tsv.

get_profiles runs with errexit disabled, because its caller is ( get_profiles ) || { restart && ( get_profiles ) ; }, so it returned the status of its last command, the check of the right server. A dead patched server is restarted and its logs are exported from disk; a dead reference server is not. The change chains the two checks, so either death takes the existing restart path.

Seen on master (5/6 on b9e4bb85, 6/6 on 1ece88b8) and on one PR run. In the same days, four runs whose patched server died got a correct report.

Validation: I replayed the get_profiles stage and everything after it on the CI artifact of master b9e4bb8 5/6, with real servers and one of them killed. Before the change, a dead left server gives the CI job's exact errors and no report. After it, the left server is restarted, the logs it wrote before the kill are exported, report/errors.log is empty, and the report reads 1 errors, 1 faster with the jit_sort_decimal run error. A dead right server and two live servers give the same result before and after.


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

`get_profiles` ends with a liveness check of the left server and then of
the right one. Its only caller runs it as `( get_profiles ) || { restart &&
( get_profiles ) ; }`, so errexit is off inside it and its status is that of
the last command, the right check. A dead patched (right) server therefore
gets restarted and its system logs exported again from disk, but a dead
reference (left) server does not: its `left-*.tsv` dumps stay empty,
`analyze_queries` and `report` fail on them with
`CANNOT_EXTRACT_TABLE_STRUCTURE ... the file is empty`, the job reports
"Errors while building the report." instead of the run error, and
`Insert historical data` fails on the missing `all-query-metrics.tsv`.

Chain the two checks, so that a dead server on either side takes the
existing restart path. Seen on master b9e4bb8 (5/6) and 1ece88b (6/6) and
on one PR run (iceberg_s3, 3/3); in the same days four runs whose patched
server died got a correct report.

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

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex) plus my own review of head 87d7adf: no findings.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. I replayed compare.sh from stage=get_profiles on the CI artifact of master b9e4bb8 5/6 with two real servers and killed the left one first. Without the change it gives the CI job's exact errors (Code: 636 on left-query-log.tsv, then Code: 107, Errors while building the report., no all-query-metrics.tsv), and the job log shows the same sequence as CI: left refused, right 1, no restart.
b Root cause explained? get_profiles ends with select 1 on the left server, then on the right one, and its caller ( get_profiles ) || { restart && ( get_profiles ) ; } disables errexit inside it, so its status is that of the right check only. A dead right server triggers the restart and the export; a dead left server does not, its dumps stay empty, and every reader of them fails.
c Fix matches root cause? Yes. The two checks are chained with &&, so a dead server on either side fails get_profiles and takes the existing restart path. No guard on the readers and no synthesized dump headers.
d Test intent preserved / new tests added? CI script change, so there is no test of the test infrastructure. Validated by the local replay and a stubbed check of the function.
e Both directions demonstrated? Yes. Dead left server: before, no restart, empty dumps, Errors while building the report.; after, a restart, the dumps hold the logs written before the kill, report/errors.log is empty and the report reads 1 errors, 1 faster with the jit_sort_decimal run error.
f Fix is general across code paths? run_tests and confirm_changes already check each server separately. The tail of restart has the same last-status shape, but on this path the second get_profiles checks both servers again. If a server stays dead, the second call fails into the existing ||: as before.
g Fix generalizes across inputs (params/datatypes/wrappers)? Covered: no dead server, dead left, dead right, both dead (stubbed check), and dead left, dead right, both alive with real servers.
h Backward compatible? (maintainer-approved exception only) Yes. With both servers alive the path is unchanged: same report status and an empty report/errors.log before and after. A dead right server gives the same result before and after.
i Invariants and contracts preserved? Yes. The caller's || semantics are unchanged, and the restarted servers are stopped by the stage's existing pkill right after, as on the dead right server path.

Session id: cron:clickhouse-impl-slot-5:20261118-143100

@clickhouse-gh

clickhouse-gh Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [87d7adf]

Summary: ✅


AI Review

Summary

get_profiles now reports a liveness failure from either performance comparison server, enabling the existing restart and log export path when the reference server dies. No actionable findings. A 16-case Bash harness with stubbed clients reproduced the original failure and verified the corrected return status and retry behavior across all server-liveness combinations; the cited CI log confirms the reported failure sequence.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI labels Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). manual approve Manual approve required to run CI pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant