Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,49 @@ true until the next version shipped.
layout already prunes as tightly. The same misattributed query reports
1.000; a 5 percent range on the sort key still reports 0.050 against a
50 percent range at 0.500.
- Eleven suites recorded every check against a major that is not a major (#1121).

`pgc_record` writes `${PGC_MAJOR:-unknown}` and PGC_MAJOR is set inside
`pgc_setup`. A suite that records but never calls `pgc_setup` wrote every check
against the literal string `unknown`.

THE GATE MATCHES A LEDGER ROW ONLY WHERE ITS MAJORS INTERSECT THE RUN'S, and no
run ever observes `unknown`. So none of those checks could be seeded, and a row
for one could never be matched again. Measured on PG17 before the fix:

smoke 9 audit 31 objstore_stash_recovery 17 phase2 42 phase3 32
phase4 38 phase5 36 phase6 43 decode_interrupts 29
hilbert_curve 184 wal_envelope 20
---- 481 of 481 records named no major ----

Same defect and same one-line fix as #1109, which reached `concurrency`,
`unique_conc` and `update_conc`. After the fix all eleven record their real major
and every record count is unchanged.

THE THREE THAT TAKE NO PG_CONFIG read it from `$1`. The runner passes the
pg_config to every suite, including those needing no cluster, and `pgc_major_of`
yields empty on a path it cannot run -- so a bad path degrades to today's
`unknown` rather than to a WRONG major. A guessed major would seed a row claiming
a major the check was never observed on, which is worse than saying nothing.

TWO GUARDS, BECAUSE NEITHER SUBSUMES THE OTHER. `run_all_versions.sh` refuses a
major whose logs carry such a record, naming the suites: that reads what was
actually written, but is silent about a suite nothing dispatched. Selftest 400
sweeps the registered suites statically: that is decidable without running
anything, but models how a suite gets its major rather than observing it.

THE POPULATION WAS WRONG TWICE AND BOTH ERRORS WERE STATIC ONES. A sweep keyed on
"defines no `check()` of its own" misses `audit`, whose own `check()` body calls
`pgc_record`. One keyed on "the file contains `pgc_record`" misses
`objstore_stash_recovery`, which uses lib.sh's `check()`. And excluding files that
match `pgc_setup` dropped `decode_interrupts`, `hilbert_curve` and `wal_envelope`
-- the three whose comments say pgc_setup is SKIPPED deliberately, matching the
same grep a call would. The text explaining the behaviour was read as the
behaviour. Selftest 400 carries both wrong regex spellings as fixtures.

`pg_upgrade` meets several of those static tests and is NOT affected: it carries
its own `check()` that never calls `pgc_record`, so it emits no records at all.
Checked by running it.

- A `CONFLICTING` badge on a changelog entry is GitHub, not git (#1116).

Expand Down
13 changes: 13 additions & 0 deletions test/audit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ fi' EXIT
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "$PG_CONFIG")"
BINDIR="$("$PG_CONFIG" --bindir)"
PORT="${PGC_PORT:-$(pgc_pick_port)}"
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand Down
14 changes: 14 additions & 0 deletions test/check_ledger.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ harness_selftest 400-a-check-result-must-be-machine an unrunnable check emits ex
harness_selftest 400-a-check-result-must-be-machine an unrunnable check still prints its old line 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine and a different major reaches the same field, so it is read not hardcoded 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine and a harness that set no major says unknown rather than an empty field 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine and does match a lib.sh source with a trailing brace 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine and it is counted 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine and it is counted, so checks run: reports it 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine and its major field carries the server major it ran under 15;16;17;18;19 never -
Expand Down Expand Up @@ -850,6 +851,7 @@ harness_selftest 400-a-check-result-must-be-machine check_text on an empty side
harness_selftest 400-a-check-result-must-be-machine check_text's empty-side line is unchanged 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine control: a well-formed record still reconciles 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine control: unknown IS a major the reconciler accepts, or the four above prove nothing 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine every suite that records also learns which major it ran on 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine fewer records than counted checks is not described as a subshell 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine lib.sh bumps PGC_CHECKS in exactly one place 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine more records than counted checks names the cause, not just the arithmetic 15;16;17;18;19 never -
Expand All @@ -868,6 +870,7 @@ harness_selftest 400-a-check-result-must-be-machine premise: the fixtures carry
harness_selftest 400-a-check-result-must-be-machine premise: the piped-loop sweep read every file it was offered 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine premise: the probe ran every helper shape once 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine premise: the sweep classified a corpus of check-calling files 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine premise: the sweep read the suites, so an empty result means something 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine premise: while a file that calls no check is not its business 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine the accounting line reconciles four outcomes against the count 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine the major [18.2] is not a major, so that record does not reconcile 15;16;17;18;19 never -
Expand All @@ -884,6 +887,7 @@ harness_selftest 400-a-check-result-must-be-machine the runner calls the record
harness_selftest 400-a-check-result-must-be-machine the runner defines the record reconciliation 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine the same ratio check, ENABLED, emits one record and passes 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine the same timing check, ENABLED, emits one record and passes 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine the source pattern does not mistake portlib.sh for lib.sh 15;16;17;18;19 never -
harness_selftest 400-a-check-result-must-be-machine the sweep finds a check inside a PIPED loop 15;16;17;18;19 never -
harness_selftest 410-a-check-must-have-been-red --mutation across two failing checks in one run is refused 15;16;17;18;19 never -
harness_selftest 410-a-check-must-have-been-red --prune REFUSES the whole prune when any orphan carries history 15;16;17;18;19 never -
Expand Down Expand Up @@ -1269,6 +1273,16 @@ harness_selftest 520-a-merged-row-must-cover-the-majors premise: the single-majo
harness_selftest 520-a-merged-row-must-cover-the-majors seeding a ledger with no prevailing set is not warned 15;16;17;18;19 never -
harness_selftest 520-a-merged-row-must-cover-the-majors the gate's printed recipe names one log per gated major 15;16;17;18;19 never -
harness_selftest 520-a-merged-row-must-cover-the-majors the warning does not fail the merge 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major a log whose records all name a major counts none, while a mixed one counts its own 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major a log with no records at all is not an offender 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major and a suite that names no major fails the major, rather than only printing 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major and it counts every offending record, not just the first 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major and the message names the offending suites 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major premise: an unreadable log is indistinguishable from a clean one, so the caller must guard it 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major premise: it is callable 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major premise: the runner defines the reader this part evals 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major the runner calls the reader over every suite's log 15;16;17;18;19 never -
harness_selftest 530-a-record-must-name-its-major the word in a REASON is not a record that names no major 15;16;17;18;19 never -
index_fetch_penalty_crossover index_fetch_penalty_crossover a 50000-row correlated range uses the custom scan, not a fetching index 15;16;17;18;19 never -
index_fetch_penalty_crossover index_fetch_penalty_crossover a selective point lookup still uses the index 15;16;17;18;19 never -
index_fetch_penalty_crossover index_fetch_penalty_crossover both paths return the same aggregate at 50000 15;16;17;18;19 never -
Expand Down
13 changes: 12 additions & 1 deletion test/check_ledger_budget.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,15 @@ suites_not_covered 249
# two under the 0.5 causation mutation, one under rel->rows / rel->tuples).
# Re-derived by COUNTING, not by adding two to a number from another tree:
# awk -F'\t' '$5=="never"' test/check_ledger.tsv | wc -l
checks_never_observed_red 1377
# 1349 -> 1363: fourteen arms across two guards for #1121 -- ten in selftest part 530
# over the runner's record reader, four in part 400 over the static sweep. Derived by
# the command above on this tree, and by the gate's census in the same run.
# RESEATED onto main carrying #1117. Main states 1368, this branch stated 1363, and
# the merged tree is neither. The ledger auto-merged silently and was checked by KEY:
# 0 main keys lost, 14 added. Re-derived by the command above.
# RESEATED onto main carrying #1107. Main states 1377, this branch stated 1382,
# and the merged tree is neither. The ledger auto-merged SILENTLY while this file
# and TESTS.md conflicted loudly -- the usual pairing -- so the union was checked
# by KEY: 0 keys lost from either side, 14 added, 0 duplicates. Re-derived by the
# command above.
checks_never_observed_red 1391
13 changes: 13 additions & 0 deletions test/decode_interrupts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@
set -uo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "${1:-}")"

# No cluster needed; pgc_setup is skipped deliberately. Provide the counters the
# shared check() helper expects.
PGC_CHECKS=0
Expand Down
13 changes: 13 additions & 0 deletions test/hilbert_curve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ set -uo pipefail
exit 1
}

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "${1:-}")"

# No cluster, so pgc_setup is skipped deliberately -- the shape wal_envelope.sh
# uses. lib.sh already zeroes the counters; they are restated so a reader can see
# this suite keeps them itself and so pgc_summary's reconciliation is meaningful.
Expand Down
13 changes: 13 additions & 0 deletions test/objstore_stash_recovery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ set -uo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "$PG_CONFIG")"
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SUITE="$SRCDIR/test/objstore_module.sh"

Expand Down
13 changes: 13 additions & 0 deletions test/phase2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ set -euo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "$PG_CONFIG")"
BINDIR="$("$PG_CONFIG" --bindir)"
PORT="${PGC_PORT:-$(pgc_pick_port)}"
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand Down
13 changes: 13 additions & 0 deletions test/phase3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ set -euo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "$PG_CONFIG")"
BINDIR="$("$PG_CONFIG" --bindir)"
PORT="${PGC_PORT:-$(pgc_pick_port)}"
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand Down
13 changes: 13 additions & 0 deletions test/phase4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ set -euo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "$PG_CONFIG")"
BINDIR="$("$PG_CONFIG" --bindir)"
PORT="${PGC_PORT:-$(pgc_pick_port)}"
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand Down
13 changes: 13 additions & 0 deletions test/phase5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ set -euo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "$PG_CONFIG")"
BINDIR="$("$PG_CONFIG" --bindir)"
PORT="${PGC_PORT:-$(pgc_pick_port)}"
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand Down
13 changes: 13 additions & 0 deletions test/phase6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ set -euo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}"

# WHICH MAJOR THIS SUITE RAN ON (#1121, the wider half of #1109). `pgc_record`
# writes `${PGC_MAJOR:-unknown}`, and PGC_MAJOR is set inside `pgc_setup` -- which
# this suite does not call, deliberately. Without this line every record it emits
# says `unknown`, and a ledger row claiming `unknown` matches no run, so none of
# these checks could ever be seeded or matched again.
#
# The runner passes the pg_config as $1 to EVERY suite, including those that need
# no cluster, so it is available here. `pgc_major_of` returns empty on a path it
# cannot run, which degrades to exactly today's `unknown` rather than to a WRONG
# major -- a guessed major would seed a row claiming a major the check was never
# observed on, which is worse than saying nothing.
PGC_MAJOR="$(pgc_major_of "$PG_CONFIG")"
BINDIR="$("$PG_CONFIG" --bindir)"
PORT="${PGC_PORT:-$(pgc_pick_port)}"
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand Down
Loading
Loading