Skip to content

test: native_fetch_bigcap gets its pytest twin, and its narrow and medium projections assert their plans (#1341, #1339) - #1503

Merged
jdatcmd merged 4 commits into
mainfrom
test/1341-native-fetch-bigcap-twin
Oct 16, 2026
Merged

jdatcmd merged 4 commits into
mainfrom
test/1341-native-fetch-bigcap-twin

Conversation

@OffgridwithJD

Copy link
Copy Markdown
Collaborator

@jdatcmd The fourth #1339 custom-scan audit entry, done as a twin PR because native_fetch_bigcap.sh had none. Stacked on #1502 (#1500 → #1502 → this). This PR's own commits are the top two.

What changed

  • FORCE_INDEX also turns the custom scan off.
  • Two new premises, in both twins: the narrow (sum(tag)) and medium (m1 || m2 || m3) projections are fetched through an index scan. Before this, only the payload query's plan was asserted.

Both projections plan as Index Scans today (measured), so these guard against a planner change. They aren't a red-first fix, and I'm not claiming one.

Two things I measured and left alone

The twin

All 15 checks by the shell's name, in two tests. It sums buffers the way the shell's awk does, and mirrors check_ratio (two-place rounding, a zero side refused). Under the decode mutation it reddens exactly the shell's arm. Five-major runs at head: 15/15 for the shell and 15/15 for the twin, on each of 15–19.

Ledger

Census 4347 / 3031 never / 1316 dated (on #1502's 4332 / 3017 / 1315), with suites_not_covered 193 → 192. One arm is dated (the right rows). The gate gives rc 0. Collection gives cluster_tests 742 -> 744, and TESTS.md gets §173. The guards pass 438/438.

🤖 Generated with Claude Code

jdatcmd and others added 4 commits October 16, 2026 17:56
…ngs read the index (#1339)

Both suites' by_index forced the index with enable_seqscan off, which
leaves the columnar custom scan on. Their whole-table range planned as
Custom Scan (PgColumnarScan), so every "by scan and by index" arm compared
the scan with itself. by_index now also turns the custom scan off, and each
suite gains a premise that the reading is an Index Scan through its index,
in both twins.

Red first, maintenance_rollback, with pgcolumnar_index_fetch_tuple finding
no row (the source fingerprint checked to differ from head): the old suite
passes 13/13, and the new one reddens all six "by index" arms. The twins
redden the same six by name.

maintenance_crash compares the state after a crash with the state before
it, both through by_index, so an index broken before the crash as well
reddens nothing, by design: the arms catch drift the crash causes. Before
this change the by-index leg was a second scan and could not see index
drift at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…four rollback arms are dated (#1339)

Census 4332 rows / 3017 never / 1315 dated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dium projections assert their plans (#1341, #1339)

test_native_fetch_bigcap.py carries all 15 checks by the shell's name in
two tests, measuring buffers as the shell's awk sums them.

Two premises are new, in both twins: the narrow (sum(tag)) and medium
(m1 || m2 || m3) projections are fetched through an index scan. Only the
payload query's plan was asserted. Both plan as Index Scans today, so these
guard against a planner change rather than fix a red. FORCE_INDEX also turns
the custom scan off, which enable_seqscan does not (#1339).

Measured and left alone:
- "the fetched rows are the right rows" compares an unforced read with an
  ORDER BY id LIMIT 10 read, which take different paths, so it reddens when
  the deferred decode corrupts a column (shell and twin). Forcing both sides
  through the index made it agree with itself, so it stays as it was.
- the two #433 ratios do not move when the cache misses every lookup or the
  cap drops every column, because those re-read only the projected columns.
  #433's own regression re-read the group's raw bytes per fetch, and there is
  no single-gate mutation for that here.

COMPLETE gains native_fetch_bigcap. TESTS.md section 173, cluster_tests
742 -> 744.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…by a deferred-decode mutation (#1341)

The suite had no rows. suites_not_covered 193 -> 192; census 4347 rows /
3031 never / 1316 dated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve, at 45a8bfa (its own commits 6bc09e0 and 45a8bfa, on #1502).

My own mutant, different from your tag one: once a column has gone over the fetch cache cap (entry->overflow[c]), the single-row fetch returns it as NULL (nulls[c] = entry->overflow[c]). payload is exactly that column here (#359). PG17:

  • shell: the fetched rows are the right rows: got [18e412d5…] want [8f6d77b4…];
  • pytest: the same hashes.

So that arm sees an over-cap column going wrong, not only a fitting one.

Your two "left alone" notes:

  • Not forcing the right-rows arm's left side: right, and well measured. Forcing both sides through the same path makes a shared fault cancel out, the same trap maintenance_crash has by design.
  • The #433 ratios that no single-gate mutation moves: keeping them never is the honest call.

The two new plan premises are guards, not red-first fixes, as you say.

@jdatcmd

jdatcmd commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

@OffgridwithJD, merging #1503 now: approved at 45a8bfa, 15/15 green, CLEAN.

@jdatcmd
jdatcmd merged commit e870752 into main Oct 16, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants