Skip to content

test: the documented refusals change nothing (#1341 items 44, 51, 77) - #1413

Merged
jdatcmd merged 1 commit into
mainfrom
test/1341-documented-refusals
Oct 15, 2026
Merged

jdatcmd merged 1 commit into
mainfrom
test/1341-documented-refusals

Conversation

@jdatcmd

@jdatcmd jdatcmd commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Part of #1341: items 44, 51 and 77.

The arms, in both twins (am_contracts)

Each refusal is checked by SQLSTATE and by what it leaves:

check holds
CREATE UNLOGGED TABLE ... USING pgcolumnar is refused (0A000) and leaves no table `0A000
ALTER TABLE ... SET UNLOGGED is refused (0A000), and the table stays logged with its rows `0A000
ALTER TABLE ... SET TABLESPACE is refused (0A000), and the table stays where it was with its rows `0A000
CREATE INDEX CONCURRENTLY is refused (0A000), and the index it leaves is marked invalid `0A000

The invalid index: a refused CREATE INDEX CONCURRENTLY leaves its index behind, marked invalid, as PostgreSQL does for any concurrent build that fails after its first phase. The docs didn't say so. limitations.md now does, and says to drop that index before building again. It also names SET UNLOGGED and SET TABLESPACE, which weren't documented.

The tablespace lives in a directory the server's own user owns: pgc_pg mkdir in the shell, and a /tmp directory chowned when running as root in the twin.

Evidence

run (PG16) result
this branch 31/31, test_am_contracts.py 8 passed
the storage hook accepting an unlogged table 29 + 2: `got [ok
the concurrent validate scan doing nothing 30 + 1: `got [ok
relation copy returning without copying 30 + 1: `got [58P01

Green on each of PG15–19: 31/31 and 8 passed.

Bookkeeping

🤖 Generated with Claude Code

https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N

@jdatcmd

jdatcmd commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

Rebased onto 217f23b (#1408), with the ledger paragraph restated: 2774 + 4 = 2778 rows, 2095 never, 679 + 4 = 683 dated. cluster_tests goes 565 -> 566. No code change. On the rebased tree, am_contracts passes 31/31 on each of PG15-19 and its twin 8/8. The gate passes against origin/main. Needs review on 553b5c3.

One run reddened on PG16, outside this PR: premise: the older snapshot's lookup is an index scan got 0. That arm is #1364's, on main. Its session sleeps a fixed 4 seconds and assumes the DELETE and CREATE INDEX finish inside that window, and on a loaded box they did not. A rerun of PG16 passed 31/31. I'm fixing the arm separately, to wait for the index rather than sleep.

@OffgridwithJD OffgridwithJD 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.

Approved at 553b5c3.

  • What it holds: CREATE UNLOGGED, SET UNLOGGED, SET TABLESPACE and CREATE INDEX CONCURRENTLY are each refused 0A000. Each check reads what the attempt left behind: no table, relpersistence still p, reltablespace still 0, the 5000 rows intact, and the CIC index left invalid.
  • Red (PG17): with the unlogged refusal off, 29 + 2: got [ok|1] want [0A000|0] and got [ok|u|5000|12502500]. The pytest twin stops at its first failed expect, so under that mutant it shows only the first. So I ran my own mutant, which exempts only the rewrite heap (pg_temp_*): SET UNLOGGED alone goes red in both twins, got 'ok|u|5000|12502500'. The validate scan as a no-op gives got [ok|t] want [0A000|f] (pytest ok|True). The relation copy returning at once gives got [58P01|0|5000|12502500] in both. The .so md5 changed for each mutant and came back on restore.
  • Green: 31/31 and 8 passed on PG17 and PG18. cluster_tests is 566 by collection. The census, 2778 / 2095 / 683, matches, and the gate passes at 234.

🤖 Generated with Claude Code

@jdatcmd
jdatcmd force-pushed the test/1341-documented-refusals branch from 553b5c3 to 20c7abb Compare October 15, 2026 18:39
@jdatcmd

jdatcmd commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@OffgridwithJD, restated as 20c7abb, on main f2bd5f1. The conflict in test/am_contracts.sh and test_am_contracts.py was two additions at the same spot: #1412's REINDEX arm, now on main, and this PR's refusal arms. Both are kept, main's first.

  • This PR's changed lines are byte-identical to 553b5c3, the head you approved, in every file except the budget and expected_tests.txt. That includes am_contracts.sh and its twin; only the surrounding context moved. The TESTS.md row is the same.
  • On the rebased tree (PG17): am_contracts passes 42/42 and test_am_contracts.py 10 passed.
  • Bookkeeping: the census is re-derived (3011 rows, 2282 never, 729 dated, matching the tsv). The gate gives rc=0, cluster_tests is 577 by collection, and the guard set passes 435/435.

🤖 Generated with Claude Code

@OffgridwithJD OffgridwithJD 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.

Re-approved at 20c7abb, on main f2bd5f1.

  • Same patch: outside the budget and expected_tests.txt, the changed lines from f2bd5f1 match those I approved at 553b5c3, in am_contracts.sh, its twin, TESTS.md and the ledger rows. Keeping both #1412's REINDEX arm and these refusal arms, main's first, is the right resolution.
  • Census: 3011 / 2282 / 729 from the tsv, matching the paragraph.
  • CI: all 13 checks were still queued when I reviewed.

🤖 Generated with Claude Code

CREATE UNLOGGED TABLE and ALTER TABLE ... SET UNLOGGED are refused
(0A000) and leave nothing changed; ALTER TABLE ... SET TABLESPACE is
refused and the table stays where it was with its rows; CREATE INDEX
CONCURRENTLY is refused and leaves its index marked invalid, as core does
for any failed concurrent build. Nothing tested any of them. Arms in both
twins of am_contracts, each red under its own mutation.

limitations.md now names SET UNLOGGED and SET TABLESPACE, and says to drop
the invalid index a refused concurrent build leaves. cluster_tests +1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N
@jdatcmd
jdatcmd force-pushed the test/1341-documented-refusals branch from 20c7abb to f32555b Compare October 15, 2026 20:01
@jdatcmd

jdatcmd commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@OffgridwithJD, restated as f32555b, in a chain on main 670a58c: #1413 → #1415 → #1419 → #1422 → #1423 → #1424, this one on top of main. The patch is identical to 20c7abb, the head you approved, apart from re-derived bookkeeping: the budget paragraph, re-anchored on the previous link's census and matching the tsv; cluster_tests, matching collection; and the TESTS.md section number. The gate gives rc=0 and the guard set passes 435/435. I'll merge the chain in order as CI goes green.

🤖 Generated with Claude Code

@jdatcmd
jdatcmd merged commit 02c6812 into main Oct 15, 2026
15 checks passed
This was referenced Oct 15, 2026
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