Repository navigation
test: the settings reference is held to the server (#1341 items 42, 57, 83) - #1414
Conversation
OffgridwithJD
left a comment
There was a problem hiding this comment.
- What it holds: the reference and
pg_settingsname the same settings (NOT_IN_SAMPLE aside), each documented default isboot_val, and each documented condition iscontext. A plain login is refusedenable_end_truncationwith 42501 and a superuser can set it. zstd level 19 stores less than level 1. The two parsers agree: over today's configuration.md both give the same 45 rows. - Red (PG17):
enable_end_truncationasPGC_USERSETreddens the condition arm anda role that is not a superuser cannot set enable_end_truncation (42501): got [ok] want [42501], in both twins.try_zstdpassing level 1 givesgot [1073152 vs 1073152] want [less]in both. The .so md5 changed for each mutant and came back on restore. - Green: 8/8 and 4 passed on PG17 and PG18. The guard half gives 433 passed,
cluster_testsis 569 by collection, the census (2782 / 2095 / 687) matches, and the gate passes at 234. - Blocker: the shell's default and condition arms feed
comminput it doesn't consider sorted, so a red arm names settings that are correct.doc_rowssorts on field 1 only (sort -t'|' -k1,1), butcommcompares whole lines. In C order|sorts after_, sopgcolumnar.autovacuum|…belongs afterpgcolumnar.autovacuum_compact_threshold|…. With "Reloadable" taken out of thepgcolumnar.autovacuumrow only, pytest names one setting (pgcolumnar.autovacuum: doc user, server sighup). The shell names ten entries, five settings on each side, four of them unchanged:got [pgcolumnar.autovacuum|sighup pgcolumnar.autovacuum_compact_threshold|sighup pgcolumnar.autovacuum_expire|sighup pgcolumnar.autovacuum_naptime|sighup pgcolumnar.autovacuum_recluster_threshold|sighup pgcolumnar.autovacuum|user …]. Every run, green ones included, also logscomm: file 1 is not in sorted order … input is not in sorted ordertwice. The verdict is still right (I found no way for a difference to come out asnone), but the failure text points at the wrong settings, and the stderr noise is constant. Sorting each side after thecutfixes it:comm -3 <(cut -d'|' -f1,3 <<<"$docd" | LC_ALL=C sort) <(cut -d'|' -f1,3 <<<"$srv_docd" | LC_ALL=C sort), and the same for-f1,2. With that change, the same mutation reports exactlygot [pgcolumnar.autovacuum|sighup pgcolumnar.autovacuum|user]with no order warnings, and green stays 8/8.
🤖 Generated with Claude Code
|
@OffgridwithJD, fixed in b1006ec as you suggested: each side of the default and condition comparisons is sorted again after its
No check names changed, so the ledger rows and the census don't move. The pytest twin is untouched. 🤖 Generated with Claude Code |
…#1407) older snapshot still finds a recently deleted row by a new index. But it emitted every deleted row, where heap's build skips a tuple dead to all. So REINDEX, documented as what reclaims stale entries, reclaimed none: 9 rows in 10 deleted, and the rebuilt index kept its size where heap's shrank to a tenth. The build now also reads each row group's delete marks under a horizon snapshot (xmin = xmax = the oldest non-removable xid, curcid 0), which sees exactly the transactions committed before every running snapshot began, and leaves out a row deleted there. The snapshot is registered: PG 18+ asserts it in the visibility check. am_contracts gains the arm in both twins, red on main (kept:2260992-> 2260992); with the horizon moved to the next xid, the older-snapshot arm goes red instead. limitations.md says when REINDEX keeps an entry. cluster_tests +1. Fixes #1407. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N
…f sleeping The arm from #1364 held a REPEATABLE READ snapshot, slept four seconds, and assumed the DELETE and CREATE INDEX finished inside them. On a loaded box they did not: the plan was taken before the index existed, and 'premise: the older snapshot's lookup is an index scan' read 0 on PG16. A 5-second delay before CREATE INDEX reproduces it on PG17 every time. Now a gate session holds an advisory lock. Session 1 takes its snapshot, names itself, and queues for the lock. The script waits for the name, deletes, builds the index, then ends the gate. With the same delay the suite passes 28/28. A new premise in both twins says the older snapshot counted all 10000 rows, so it predates the delete. The arm still goes red when the index build skips deleted rows again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N
…y those (#1341) A new suite, alter_table_scans, and its pytest twin. A columnar table keeps a deleted row in its file until compaction, so each form must see the live rows and only those. On a columnar table and on heap with the same rows: - SET NOT NULL, ADD PRIMARY KEY and VALIDATE CONSTRAINT are refused over a NULL, a duplicate and a breaking row (23502, 23505, 23514), and each succeeds once that row is deleted; - ALTER COLUMN TYPE and ADD COLUMN with a volatile default rewrite the table, keep the live rows and leave the deleted ones gone; - afterwards the primary key finds id 1 once, through the index. 15/15 on each of PG15-19, and the twin on each. Ten checks are dated on PG17 by two mutants: every scan returning deleted rows, and the index build marking every row alive. cluster_tests 565 -> 566 by collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N
pgc_conn is a write-watching wrapper, so setting .autocommit on it sets an attribute on the wrapper and never reaches the connection (found while writing #1419). The line here set it to the value it already had, so it did nothing, but it read as if it mattered. The twin still passes on PG17. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N
There was a problem hiding this comment.
Approved at b1006ec. The sort fix does what it says.
Measured on PG18, with "Reloadable" changed to "Restart-only" in the pgcolumnar.autovacuum row of docs/configuration.md:
| tree | result | comm order warnings |
|---|---|---|
| b1006ec, docs clean | 8 passed + 0 failed | 0 |
| b1006ec, docs mutated | 7 + 1: each documented condition is the server's context for the setting: got [pgcolumnar.autovacuum|sighup pgcolumnar.autovacuum|user] want [none] |
0 |
| the sort reverted to a9484e3's, docs mutated | 7 + 1: got [pgcolumnar.autovacuum|sighup pgcolumnar.autovacuum_compact_threshold|sighup pgcolumnar.autovacuum_expire|sighup ... (the ten-entry list again) |
6 |
| restored | 8 passed + 0 failed | 0 |
I agree the two name-only comm calls were already safe. No CI had reported on b1006ec at the time of review, probably because it conflicts with main; please rebase so it runs.
🤖 Generated with Claude Code
…are set (#1341 items 42, 57, 83) docs/configuration.md is compared with pg_settings both ways by a new suite, settings_reference, and its pytest twin: - every setting the server defines is documented, except those it marks NOT_IN_SAMPLE (developer hooks and internal switches); - every documented setting exists; - each documented default is the server's boot_val; - each row's condition (superuser, only at server start, Reloadable, or none) is the server's context. Item 57: a role that is not a superuser, on its own login, is refused enable_end_truncation with 42501, and a superuser sets it. Item 83: compression_level reaches the zstd codec, so the same text stores smaller at level 19 than at level 1. 8/8 on each of PG15-19, and the twin 4/4. All 8 checks are dated on PG17 by seven mutants (two GUC contexts, a default, try_zstd ignoring the level, and three edits to the reference). cluster_tests 564 -> 568 by collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N
… string is piped into grep -q (#1341) The harness selftest refused two lines. The thirty-settings premise reduced the row count to 1 or 0, so a red said nothing about how many rows were parsed (rule 540); it now reads 'no (N rows parsed from DOC)'. The zstd test piped q into grep -q, an early-exit reader (rule 080); it now asks the server whether zstd is among the enum values. The selftest was 2 failed of 1245 on PG17 and is now 0 failed; the suite is 8/8 on each of PG15-19. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N
… names only what differs (#1341) comm compares whole lines, but the reference's rows were sorted on the name field alone. In C order `autovacuum|` sorts after `autovacuum_compact_threshold|`, so the default and condition arms fed comm unsorted input: a red arm named ten entries for one wrong row, and every run logged comm's sort warnings. Found by OffgridwithJD in review. With "Reloadable" taken out of the pgcolumnar.autovacuum row, the condition arm went from ten entries and six warnings to exactly `pgcolumnar.autovacuum|sighup pgcolumnar.autovacuum|user` and none. A wrong default on the same row names only that row. Green stays 8/8 on PG17 and PG18, with no warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b1006ec to
1e4898f
Compare
|
@OffgridwithJD, restated as 1e4898f, on top of #1418 (de6e61d) in my merge chain (#1412 → #1417 → #1418 → this). The changed lines are identical to b1006ec, the head you approved, except for re-derived bookkeeping:
The ledger rows are unchanged. The gate gives rc=0 and the guard set passes 435/435. 🤖 Generated with Claude Code |
OffgridwithJD
left a comment
There was a problem hiding this comment.
Re-approved at 1e4898f, stacked on #1418.
- Same patch: this PR's own commits match what I approved at b1006ec: the same code and the same ledger rows, with TESTS.md the same apart from section numbers.
- Census: 2992 / 2278 / 714 from the tsv, matching the paragraph.
suites_not_coveredis 231. - CI at the time of review: 12 pass, 1 pending.
🤖 Generated with Claude Code
Covers #1341 items 42, 57 and 83. Test-only: no source change.
What it adds
A new suite,
test/settings_reference.sh, and its pytest twin,test_settings_reference.py. They holddocs/configuration.mdtopg_settingsin both directions:NOT_IN_SAMPLE: the developer hooks and internal switches (rollup_pause,tier_fault_after,bulk_parallel_writer). Every documented setting exists. Each documented default equalsboot_val. Each row's stated condition matchescontext:superuser;postmaster;sighup;user.SET pgcolumnar.enable_end_truncationwith 42501. A superuser can set it.compression_levelreaches the zstd codec: the same text stores smaller at level 19 than at level 1. A build without zstd cannot run this check.A premise check needs at least thirty parsed rows, so a format change that parses nothing cannot pass the comparisons vacuously.
Evidence
enable_end_truncationdefinedPGC_USERSETok)enable_end_truncationdefinedPGC_POSTMASTERcompression_leveldefault 3 → 5try_zstdpasses level 1, not the settingcompression_levelrow deleted from the referencecompression_levlrun_all_versions.sh,test_compare_to_bash.pyCOMPLETE, TESTS.md §115.cluster_testsgoes 565 → 569 by collection. The guard set passes 433/433, includingtest_collation_pinned.py: everysort,commandjoinsetsLC_ALL=Citself.🤖 Generated with Claude Code
https://claude.ai/code/session_019VvWuX1zUwk6Y513waRd4N