Hit on #484's CI, PG18. The same job re-run on the identical commit passed, so
this is a flake, and the log says exactly which one.
What happened
/tmp/pgcolumnar-matrix-18.2QoMGY/test/native_agg.sh: line 41: echo: write error: Broken pipe
FAIL count(*) uses the metadata agg node: got [no] want [yes]
PASS sum/min/max uses the metadata agg node
The check that failed and the check that passed on the next line call the same
helper on plan text from the same node.
Why
test/native_agg.sh:41:
has_aggnode() { echo "$1" | grep -q 'Columnar Vectorized Aggregates' && echo yes || echo no; }
The suite runs under set -o pipefail. grep -q exits as soon as it matches, so
the writer can take EPIPE, and pipefail then calls the whole pipeline failed.
The && arm is skipped and the helper answers no while the line it was looking
for is present.
This is the shape #473 already found once, in harness_selftest:
Never pipe into an early-exit reader under pipefail. The tell is a
Broken pipe line beside a result the same run's summary contradicts.
That is precisely the tell here.
Why it is worth fixing rather than tolerating
The failure direction is the dangerous one. It reports "the metadata aggregate
node did not run" when it did, which reads as a real planner regression in
exactly the area #133 and #140 live in. Anyone triaging it starts by looking for
a costing change that is not there.
has_gather() on line 42 has the identical shape.
Fix
No pipe and no subprocess:
has_aggnode() { case "$1" in *"Columnar Vectorized Aggregates"*) echo yes;; *) echo no;; esac; }
case cannot take EPIPE and is faster besides.
Scope
About twenty instances of <string> | grep -q exist across test/, including
native_ownership.sh:34, native_groupagg.sh:235 and :326, and several in
fuzz_arrow.sh and fuzz_parquet.sh. They are not all equally exposed: the
larger the string, the likelier the writer is still writing when the reader
exits. Worth sweeping the lot in one pass, since the fix is mechanical and the
failure mode is a false red that names innocent code.
A harness_selftest check that greps test/*.sh for the shape would keep it
from coming back, which is what stopped the SUITES mistake recurring.
Hit on #484's CI, PG18. The same job re-run on the identical commit passed, so
this is a flake, and the log says exactly which one.
What happened
The check that failed and the check that passed on the next line call the same
helper on plan text from the same node.
Why
test/native_agg.sh:41:The suite runs under
set -o pipefail.grep -qexits as soon as it matches, sothe writer can take
EPIPE, andpipefailthen calls the whole pipeline failed.The
&&arm is skipped and the helper answersnowhile the line it was lookingfor is present.
This is the shape #473 already found once, in
harness_selftest:That is precisely the tell here.
Why it is worth fixing rather than tolerating
The failure direction is the dangerous one. It reports "the metadata aggregate
node did not run" when it did, which reads as a real planner regression in
exactly the area #133 and #140 live in. Anyone triaging it starts by looking for
a costing change that is not there.
has_gather()on line 42 has the identical shape.Fix
No pipe and no subprocess:
casecannot take EPIPE and is faster besides.Scope
About twenty instances of
<string> | grep -qexist acrosstest/, includingnative_ownership.sh:34,native_groupagg.sh:235and:326, and several infuzz_arrow.shandfuzz_parquet.sh. They are not all equally exposed: thelarger the string, the likelier the writer is still writing when the reader
exits. Worth sweeping the lot in one pass, since the fix is mechanical and the
failure mode is a false red that names innocent code.
A
harness_selftestcheck that grepstest/*.shfor the shape would keep itfrom coming back, which is what stopped the
SUITESmistake recurring.