Skip to content

Drop stale totals and extremes ports in MergingAggregatedStep - #114027

Merged
PedroTadim merged 7 commits into
ClickHouse:masterfrom
groeneai:fix-merging-aggregated-totals-extremes
Aug 26, 2026
Merged

PedroTadim merged 7 commits into
ClickHouse:masterfrom
groeneai:fix-merging-aggregated-totals-extremes

Conversation

@groeneai

@groeneai groeneai commented Aug 9, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #113708

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Not required. The only shape found to reach this logical error needs inject_random_order_for_select_without_order_by, documented as only useful for testing and development, so no released configuration is known to be affected. It is fuzzer-reachable (BuzzHouse randomizes it), which is how the abort was found.

Description

Found 2026-08-08 by AST fuzzer (amd_debug) (STID 0993-250f, report) on PR 112384 as a bystander: Logical error: Block structure mismatch in function connect between Limit and MergingAggregatedBucketTransform. It aborts in Port.cpp:22 connect from MergingAggregatedMemoryEfficientTransform.cpp:577, so at pipeline construction, not execution.

MergingAggregatedStep::transformPipeline inherited the pipeline's totals and extremes ports, then attached its merging transforms to them. addMergingAggregatedMemoryEfficientTransform uses the StreamType-less Pipe::addSimpleTransform overload, so the getter also runs on totals_port. The transform it creates has an empty input header, while that port still carries the aggregate-state header, hence the mismatch. Where the transform is not attached to those ports, the stale port survives into TotalsHavingStep, which requires it to be null.

The fix mirrors AggregatingStep.cpp:398-399, the other half of two-stage aggregation: drop the current totals and extremes, which this step invalidates and are recalculated afterwards. One call before the branch point covers all three merge branches, the extremes stream and all five construction sites. The other caller needs no drop: it builds pipes from SourceFromNativeStream, so neither port exists.

Reachability decides the category: two Merge children must reach the step still carrying a totals port, and the setting named above is the only producer found among candidates measured with an instrumented hasTotals. The guard is worth adding anyway, since the state is constructible today.

The test asserts the build-time shapes and each arm's merge branch with EXPLAIN PIPELINE, plus values against a hand-derivable ground truth.

Two unrelated defects, identical on both sides of this change: Chunk info was not set for chunk in GroupingAggregatedTransform, owned by #113266, and the same setting over merge() loses a child's rows. An earlier revision of this line attributed the first to MaterializingTransform dropping chunk info; that is wrong, since it only calls detachColumns/setColumns and the ISimpleTransform default swaps chunk_infos through.

Issue 113708 reports this guard firing over merge() through a set-operation plan with no MergingAggregatedStep; that did not reproduce, so this PR does not close it.


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

Version info

  • Merged into: 26.9.1.145 (included in 26.9 and later)

groeneai and others added 3 commits August 9, 2026 05:01
MergingAggregatedStep::transformPipeline inherited whatever totals and
extremes ports the pipeline it was handed already had, and then attached
its merging transforms to them.

addMergingAggregatedMemoryEfficientTransform uses the StreamType-less
Pipe::addSimpleTransform overload, so Pipe::addSimpleTransform applies the
getter to totals_port and extremes_port as well as to the main ports. The
resulting MergingAggregatedBucketTransform has an empty input header by
construction, because it is designed to consume GroupingAggregatedTransform's
empty, ChunksToMerge-bearing chunks. The totals port never passes through
GroupingAggregatedTransform, so it still carries the real aggregate-state
header and connect fails on the column count:

  Block structure mismatch in function connect between Limit and
  MergingAggregatedBucketTransform stream: different number of columns

On the branches that do not attach that transform to the special ports, the
stale port instead survives into TotalsHavingStep, which requires it to be
null, giving "Totals having transform was already added to pipeline".

Do what AggregatingStep, the other half of two-stage aggregation, already
does at AggregatingStep.cpp:398-399: forget the current totals and extremes,
since the step is about to invalidate them and TotalsHavingStep recalculates
them afterwards. One call before the branch point covers the memory-efficient,
memory-bound and non-memory-efficient branches, the extremes stream, and all
five MergingAggregatedStep construction sites. The other caller of
addMergingAggregatedMemoryEfficientTransform, the external-aggregation
temp-file merge, builds its pipes from SourceFromNativeStream only, so both
ports are null there and the drop is a no-op.

Found by the AST fuzzer over a merge() spanning 58 tables. Reduced to three
tables and a single SELECT; the plain SELECT fails too, so this is not
limited to EXPLAIN. The only load-bearing setting of the fuzzer query is
inject_random_order_for_select_without_order_by.
The first version of 04850 never reached the code path it exists for.

Pipe::uniteTotals only builds its Concat -> LimitTransform pair when more
than one pipe carries a totals port (Pipe.cpp:77-105), and a Distributed
child planned at WithMergeableState carries none, so a fixture of one view
plus one Distributed left a single port that uniteTotals returned
unchanged. With one merge thread, addMergingAggregatedMemoryEfficientTransform
also returns early via addTransform and never calls addSimpleTransform. The
test therefore reddened on the sibling symptom, "Totals having transform was
already added to pipeline", and never on the reported one.

A second view child and several merge threads produce the reported message
verbatim:

  Block structure mismatch in function connect between Limit and
  MergingAggregatedBucketTransform stream: different number of columns

The build-time arms use EXPLAIN PIPELINE, which constructs the pipeline
without running it. That is enough, because connect runs during
construction, and it keeps the arms clear of two unrelated pre-existing
runtime errors that this shape also trips.

Each arm now asserts which merge branch it reached by naming the transform
that identifies it, so a later plan change cannot move an arm onto a branch
it does not mean to cover. The memory-bound and extremes arms are gone:
instrumenting the step showed memoryBoundMergingWillBeUsed() and the
extremes port are never reached in any shape that arrives with a totals
port, so those arms asserted nothing while claiming coverage.

Values are asserted separately, on a shape that needs no development-only
setting, against a hand-derivable ground truth: three children of two rows
give 90, and per key 30 and 60. The previous reference pinned 30, which was
the output of an unrelated pre-existing defect where
inject_random_order_for_select_without_order_by over merge() loses one
child's rows. The equality oracle it came with compared two identically
degraded executions and could not fail; it is replaced by literals plus a
UNION ALL control that cannot share a Merge-specific degradation.
Both memory-efficient sub-branches construct MergingAggregatedBucketTransform,
so filtering EXPLAIN PIPELINE on that name alone told them apart from nothing:
the several-thread arm and the single-thread arm returned 1 for the same reason.
A later plan change moving the several-thread arm onto the early-return path
would have kept the test green while losing all coverage of the abort it exists
to catch.

The discriminator is the multiplicity suffix. getProcessorDescriptionLine
appends " x N" when a group has more than one processor, and doDescribePipeline
groups consecutive same-named processors, so the resize-then-addSimpleTransform
path prints one transform per merge thread while the addTransform early return
prints a bare one. Master already asserts this shape in
01551_mergetree_read_in_order_spread.reference.

The several-thread arm now requires the exact count, which is pinned by
aggregation_memory_efficient_merge_threads in the same query and therefore also
confirms the resize honoured the setting; the single-thread arm requires the
transform present and the suffix absent. Verified each predicate reddens on the
mutation that matters: swapping either arm's merge_threads flips its flag. Two
controls, because these oracles are count-shaped and a non-matching pattern
yields a plausible zero rather than an error: the old substring predicate still
returns 1 under the first mutation, and an ASCII x spelling of the sign matches
nothing against output containing the real U+00D7.

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (3 rounds, clean on round 3)

An independent reviewer and a second model reviewed this change cold each round. Round 3 found
nothing; rounds 1 and 2 each found 3 majors, all fixed below. The one-line source change drew zero
findings in all three rounds; every fix was to the test or the description.

❌ Blockers: none.

⚠️ Majors, all fixed

Finding Fix
The test's two memory-efficient arms shared one predicate, so neither identified its sub-branch: both branches construct MergingAggregatedBucketTransform, one via addSimpleTransform (the aborting path) and one via an addTransform early return. A later plan change moving the first arm onto the early-return path would have kept the test green while losing all coverage of the abort. Arms now assert the multiplicity suffix EXPLAIN PIPELINE prints for a grouped processor, which is the actual discriminator: one transform per merge thread versus a bare one. Each predicate was shown to redden on the mutation that matters, with a control confirming the old predicate is blind to it.
The changelog entry claimed a universal negative ("every shape that reaches this needs the setting") that the evidence, a bounded search over enumerated candidates, does not establish. Weakened to what was measured ("the only shape found"), and the honest reason the guard is worth adding was added: the setting is randomized by BuzzHouse, which is how the abort surfaced.
No CI provenance, on a change whose entire justification is a fuzzer abort. STID, check name and the canonical report URL added. The URL is the CI database's own report_url value rather than a hand-assembled one.

💡 Noted, deliberately not addressed here

Two pre-existing defects were found while reproducing this one, each proven independent by a shape
with no WITH TOTALS, where this change is a no-op and both binaries behave identically:
MaterializingTransform dropping a chunk's info, and the same development-only setting losing a
child's rows over merge(). Both are named in the description. Neither is folded in: a second root
cause does not belong in a two-line robustness fix.

Reachability, since it decides the changelog category: two Merge children must reach the step
still carrying a totals port. Candidate producers were enumerated by grepping every writer of a
totals port and measured with an instrumented probe at this step; the only one found is a setting
documented as useful only for testing and development, set by no CI config. Hence
Not for changelog. The abort itself is real and reachable from an ordinary query once that setting
is on.

Session id: cron:clickhouse-review-slot-9:20260809-100002

@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Three Merge children (two views + one Distributed) and one SELECT ... WITH TOTALS, currentDatabase()-scoped, aborting on every run of pristine master with the reported message. Also reproduced from the recovered fuzzer fixture verbatim. Exactly one of that query's 11 settings is load-bearing: inject_random_order_for_select_without_order_by = 1.
b Root cause explained? Yes. addMergingAggregatedMemoryEfficientTransform uses the StreamType-less Pipe::addSimpleTransform overload, so the getter is applied to totals_port and extremes_port as well as the main ports. MergingAggregatedBucketTransform's input header is empty by construction (it consumes GroupingAggregatedTransform's ChunksToMerge chunks), while the totals port still carries the aggregate-state header, so connect fails on the column count. Frame 8 of the fuzzer stack is Pipe.cpp:634, the totals-port call, which confirms the chain. The producer of the surviving port was read off an instrumented Pipe::uniteTotals rather than inferred: MaterializingTransform, attached per merge child at StorageMerge.cpp:1328.
c Fix matches root cause? Yes. The ports are dropped at the step that is about to invalidate them, which is what AggregatingStep.cpp:398-399 already does for the first stage of the same operation. No assertion relaxed, no bound widened, no no-random-* tag, no no-parallel tag.
d Test intent preserved / new tests added? New test 04850_merging_aggregated_drops_totals_and_extremes. Part 1 asserts the three build-time shapes via EXPLAIN PIPELINE, each arm pinning the merge sub-branch it reached by the transform's multiplicity: the several-thread arm requires MergingAggregatedBucketTransform × 4, one per merge thread, which is the path that applies the getter to totals_port; the single-thread arm requires the transform present and the multiplicity suffix absent, which is the early-return path; the non-memory-efficient arm requires zero bucket transforms. Part 2 asserts values on a shape needing no development-only setting, against a hand-derivable ground truth (3 children x 30 = 90) plus an in-test UNION ALL control. No existing test weakened or removed.
e Both directions demonstrated? Yes. Pristine master aborts with the exact reported message, Block structure mismatch in function connect between Limit and MergingAggregatedBucketTransform stream: different number of columns; the patched binary matches the reference. Every oracle is shown able to redden. Values: dropping one merge child moves all of them (90 to 60, 30/60 to 20/40). Branch pinning, in the direction that matters, namely a later plan change silently moving an arm onto the other sub-branch: setting the several-thread arm's merge_threads to 1 takes its flag 1 to 0, and setting the single-thread arm's to 4 takes its multiplicity flag 0 to 1. Two controls guard against a silently non-matching pattern, since these oracles are count-shaped: the substring-only predicate this replaces still returns 1 under the first mutation, which is the blindness being fixed, and an ASCII-x spelling of the multiplication sign returns 0 against output that does contain × 4.
f Fix is general across code paths? Yes. The single call sits before all three branches, so the memory-efficient, memory-bound and non-memory-efficient paths are covered, and all five MergingAggregatedStep construction sites funnel into this one method. The sibling site in AggregatingStep is already covered by its own drop. The other caller of addMergingAggregatedMemoryEfficientTransform, the external-aggregation temp-file merge, builds its pipes from SourceFromNativeStream only, so neither special port exists there (read at AggregatingTransform.cpp:1345, not assumed).
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes, and type wrappers are not a carrier: the mismatch is a column-count difference (N versus 0), independent of element types. The test varies the merge branch and the merge-thread count; both analyzers were exercised during reduction. The extremes arm was removed rather than kept as decoration: hasExtremes measured 0 in every shape reachable here, so an extremes arm would have asserted nothing.
h Backward compatible? (maintainer-approved exception only) Yes. No setting default change, no new setting, no serialization or format change, so no SettingsChangesHistory.cpp entry and no version gate. Any reliance on shard totals surviving the merge is reliance on a shape that aborts or throws today.
i Invariants and contracts preserved? Yes. dropPort attaches a NullSink and nulls the pointer, so the stream is consumed with no dangling port and no leak. The downstream TotalsHavingStep, added immediately after this step by the planner, requires totals_port to be null and throws otherwise, so dropping is what it expects. Extremes are re-derived by addExtremesTransform, which itself drops any pre-existing port.

Session id: cron:clickhouse-impl-slot-4:20260809-094000

@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

cc @davenger @nihalzp, could you review this? MergingAggregatedStep inherited the pipeline totals and extremes ports and then attached its merging transforms to them, and MergingAggregatedBucketTransform has an empty input header while those ports still carry the aggregate-state header, so connect failed on the column count. The fix drops those ports at the step that invalidates them, which is what the sibling AggregatingStep already does.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Aug 9, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d5044f4]

Summary: ❌

job_name test_name status info comment
Fast test (arm_darwin) FAIL
Install ClickHouse Config FAIL IGNORED

AI Review

Summary

Drops inherited totals and extremes ports before MergingAggregatedStep rewires the pipeline, which matches the existing AggregatingStep contract and prevents stale special streams from reaching merge transforms that cannot consume them. I did not find a current correctness, safety, performance, test-evidence, or PR-metadata issue in the implementation or the accompanying stateless coverage.

Final Verdict

✅ No review findings.

LLVM Coverage Report

Metric Baseline Current Δ
Lines 87.20% 87.20% +0.00%
Functions 91.90% 91.90% +0.00%
Branches 79.40% 79.30% -0.10%

Changed lines: Changed C/C++ lines covered: 5/5 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Aug 9, 2026
@PedroTadim PedroTadim assigned PedroTadim and unassigned PedroTadim Aug 9, 2026
@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — c2cf40a

Every 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 CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (amd_debug) / Logical error: Chunk info was not set for chunk in GroupingAggregatedTransform (STID 3970-479a) pre-existing trunk bug, not caused by this PR (15 rows / 12 unrelated PRs, first seen 2026-07-21) #113266 (external, open)
AST fuzzer (amd_debug, targeted) / same STID 3970-479a same trunk bug #113266 (external, open)
AST fuzzer (amd_debug, targeted, old_compatibility) / same STID 3970-479a same trunk bug #113266 (external, open)
Stress test (amd_msan) / Logical error: Chunk info was not set for chunk in MergingAggregatedTransform (STID 3800-3cec) sibling site of the same family, pre-existing (11 rows / 8 unrelated PRs, first seen 2026-07-20) #113266 (external, open)
Stress test (arm_tsan) / same STID 3800-3cec same trunk bug #113266 (external, open)
Sync - CH Inc sync (private, not actionable by me)

None of these are caused by this PR: this PR only drops stale totals/extremes ports in
MergingAggregatedStep, and both STIDs predate it on unrelated PRs.

Session id: cron:our-pr-ci-monitor:20260809-220000

@clickhouse-gh

clickhouse-gh Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing d5044f422 with master a6b366453 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of a835d3c55; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 709.96 MiB 706.91 MiB -3.04 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

7 translation units recompiled, 11 s compile time in total, 7 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 99c09b1

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
AST fuzzer (amd_debug, targeted) self-hosted runner reclaimed mid-Run, 0 tests executed a fix task is created (investigating at full effort - fixing PR link to follow on this PR)
AST fuzzer (amd_debug, targeted, old_compatibility) same, re-ran 3x on 3 different runner instances a fix task is created (investigating at full effort - fixing PR link to follow on this PR)
Stress test (arm_release) same, on pr-arm-medium a fix task is created (investigating at full effort - fixing PR link to follow on this PR)

All three carry the identical check annotation, "The self-hosted runner lost communication with
the server", with steps 1-3 green, step 4 Run at conclusion: null, step 8 Post Checkout code still pending, job logs 404 BlobNotFound, and zero CIDB rows for these three check
names at this head against 300,091 ingested rows for the head overall. So no test ran and no
result was published; this is not a code failure on the diff, which is three lines in
MergingAggregatedStep.cpp plus one test.

Two things I checked rather than assumed:

The reporting half of this is already fixed and is working here. My merged #114921 is an
ancestor of this head, and each of the three child nodes now carries its own
ext["errors"] entry naming the job, where previously that diagnosis landed only on the
workflow root. The healthy AST fuzzer (amd_debug) node on the same head carries no such
entry, so the discriminator is not vacuous. What is left unowned is the runner death itself,
which #114921 deliberately scoped out.

The three reds are not the GroupingAggregatedTransform chunk-info family (STID 3970-479a)
I reported on this PR on 2026-08-09. All three of those rows sit at the earlier head
c2cf40aac029c79f; at this head there are none in either CIDB column. Different cause, and
that family already has its own external owner.

Negative control on the annotation: across 12 other recent PR workflow runs, 14 failing jobs
each carry exactly one annotation and none of them is the lost-communication message, so the
signature is specific to these three jobs rather than a generic artifact.

Session id: cron:our-pr-ci-monitor:20260819-233000

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the runner-reclaim mid-Run job kill created: #115569

Scope note, because it matters for this head: that fix does not recover this run. The hourly retry_infra_failures.yml selects .attempt == 1 by design, and this run is attempt=3. What #115569 fixes is the classifier arm that suppressed the retry in the first place: a Run step with conclusion: null scored as a real failure, and since the run-level gate requires every failed job to be classified infrastructure, that one job blocked the retry for the whole run.

The separate operational action here is a manual re-run of the three failed jobs. Two of them (AST fuzzer (amd_debug, targeted) and Stress test (arm_release)) have had only one real execution; old_compatibility genuinely ran three times on three different runner instances and died each time.

@PedroTadim

Copy link
Copy Markdown
Member

@nihalzp this PR is very small and seems ok to merge?

@PedroTadim
PedroTadim enabled auto-merge August 20, 2026 13:58
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - f929eb3

Every 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 CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
AST fuzzer (amd_debug, targeted) self-hosted runner reclaimed mid-Run, 0 tests executed #115569 (mine, open)
Docker server image wedged 4h47m inside apt-get update on the arm64 leg, then killed by the 18000s job cap #113869 (mine, open)

Neither is a code failure on this diff, which is three lines in MergingAggregatedStep.cpp
plus one test. Both owners are linked from their diffs, not their titles:

AST fuzzer (amd_debug, targeted) carries the annotation "The self-hosted runner lost
communication with the server", with steps 1-3 green, step 4 Run at conclusion: null, and
step 8 Post Checkout code still pending. That is exactly the shape #115569 adds to the
infra-retry predicate (elif .[0].conclusion == null then true). CIDB has zero rows for this
check name at this head while its five sibling AST fuzzer arms all ingested success, so no
result was published rather than a fuzzer finding being reported. Breadth: the arm is non-green
on 36 distinct PRs in the last 4 days and 0 true-master runs.

Docker server image ran 18001.6s against an 18000s cap. Useful work stopped at 17:37:10 on
#10 [ch-builder 2/11], whose last output is a jammy-backports InRelease fetch; there is no
further output for 4h47m until WARNING: Job timed out. #113869 bounds each docker buildx
invocation with timeout, and its own rationale names this mechanism: Acquire::http::Timeout
is an inactivity timeout, so an apt mirror that keeps trickling bytes is never bounded by it and
the build runs until the job's own cap kills it.

One thing worth separating out, since it is not in the table: every non-green CIDB row at this
head is Performance Comparison review output (unstable or slower, all with
check_status = success), which is a perf delta reported for a human rather than a failure.
There are no FAIL or ERROR test rows at this head at all.

The three reds I ledgered at the earlier head 99c09b1ba7d73796 included a Stress test (arm_release) arm that is green here, and the old_compatibility fuzzer twin is OK here too.

Session id: cron:our-pr-ci-monitor:20260820-233008

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger d5044f4

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Fast test (arm_darwin) / Install ClickHouse Config macOS runner disk exhaustion: tests/config/install.sh: line 394 ... keeper_port.xml: No space left on device, during config install before any test ran #113605 (ours, open)

Session id: cron:our-pr-ci-monitor:20260825-170000

@PedroTadim
PedroTadim added this pull request to the merge queue Aug 26, 2026
Merged via the queue into ClickHouse:master with commit 66b1132 Aug 26, 2026
348 of 352 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 26, 2026
pull Bot pushed a commit to AKJUS/ClickHouse that referenced this pull request Sep 20, 2026
retry_infra_failures.yml classifies each failed job as infrastructure-vs-real
and re-runs the workflow when all of them are infrastructure. The classifier
had no arm for a "Run" step whose conclusion is null, so it scored that job a
real failure; because the run-level gate requires every verdict to be true, one
such job suppressed the retry for the whole run.

A null conclusion means GitHub finalized the job while its main step had never
reported (completed_at is also null). That is the same "no verdict produced"
class the adjacent length == 0 and "skipped" arms already treat as
infrastructure. A test that actually ran and failed reports
conclusion="failure" with both timestamps set, so this arm cannot absorb real
failures.

Found on ClickHouse#114027 head 99c09b1, where AST fuzzer (amd_debug, targeted,
old_compatibility) was killed mid-Run on runner i-00c834ca4e798946f, with
GitHub's "The self-hosted runner lost communication with the server"
annotation. That job and two others reported failure having run zero tests and
published zero CIDB rows. Why the runner went away is not established: the job
logs are purged and its praktika report was never uploaded, so nothing here
asserts a mechanism for the death.

Validated against real captured job payloads, with the jq program extracted
verbatim from the file in both arms so they cannot diverge by transcription.
Run 32270257975 (171 jobs, captured paginated and asserted against
total_count): verdicts false/true/true -> should_rerun=false before, and
true/true/true -> should_rerun=true after, with the false attributable to
exactly the killed job. Over 60 recent failed pull_request.yml runs (10264
jobs, 158 failed, 0 null-Run instances) classification is identical before and
after, and a 17-case matrix across the whole step-conclusion domain changes
exactly one case, the intended one; "cancelled" is deliberately left alone.

The state is rare: zero occurrences in those 60 runs. This also does not
recover the run that prompted it, which is attempt=3 while the workflow selects
.attempt == 1 by design; widening that anti-loop bound is a separate question
with a different risk profile. MAX_RERUNS, the attempt gate and the 6 hour
cutoff are unchanged, as is the job filter feeding the classifier.

Co-Authored-By: Claude Fable 5 <[email protected]>
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 groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding pr-not-for-changelog This PR should not be mentioned in the changelog 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.

4 participants