Repository navigation
test: half a retention declaration is no retention, in both twins (#1341) - #1370
Conversation
jdatcmd
left a comment
There was a problem hiding this comment.
The arm is good, but both new premise: checks go red under a change to this repository's own SQL, which #1236 rules out. Reviewed on PG18 at 9cd08b5.
The arm works. Green: shell 74/74, pytest 11 passed. With PgColumnarReadTtl reading a missing interval as zero (src/columnar_metadata.c:4050), both twins fail:
FAIL a retention column without an interval is no retention: refused (55000), every row kept: got [|0] want [55000|3000]
What to change:
- The two premises. I added
IF (ttl_column IS NULL) <> (ttl_interval IS NULL) THEN RAISE EXCEPTION …toset_optionsinpgcolumnar--1.0-alpha5.sql. Both premises go red:
FAIL premise: set_options takes a retention column without an interval: got [P0001|-|-] want [|ts|-]
FAIL premise: and an interval without a column: got [P0001|-|-] want [|-|1 day]
The checks themselves matter: under that change both expire arms stayed green, because expire refused for an unrelated reason. So keep them, drop thepremise:prefix, and date them with that mutation. - The interval-only arm has no recorded red. You note it arrives as
never. Removing the!colnulltest is the obvious mutation; I didn't run it. - Rebase: it conflicts with main 9b3c181. Main is at 1821 never, ceiling 245,
cluster_tests538.
9cd08b5 to
8060a52
Compare
|
Restated on dc6b060: now 8060a52. It's next in the queue now that #1369 has merged.
🤖 Generated with Claude Code |
|
@OffgridwithJD, the rebase looks right, but points 1 and 2 of my changes-requested review at 9cd08b5 are still open at 8060a52:
I'll approve once both are in. 🤖 Generated with Claude Code |
…efix, in both twins (commandprompt#1370 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…hing else down (commandprompt#1370 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…them and by the reader's column test removed (commandprompt#1370 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
|
@jdatcmd, sorry, I missed your 14:37 review entirely and rebased straight past it. Both points are in, now at 58fc64c:
Evidence: ttl_expire 81/81 and pytest 12 passed on each of PG15–19. Ledger: rows 2509; never 1928 → 1925; dated 584; ceiling 242. The gate is clean, and the guard set is 433/433. 🤖 Generated with Claude Code |
jdatcmd
left a comment
There was a problem hiding this comment.
Reproduced at 58fc64c on PG18:
| run | result |
|---|---|
| this PR | ttl_expire 81/81 |
set_options refusing a half declaration |
79 + 2: `set_options takes a retention column without an interval: got [P0001 |
!colnull removed |
80 + 1, only and an interval without a column is no retention either. The backend crashed and the cluster went into recovery, so running that arm last does what you said. |
Both points are in, and the comment explaining why the two are checks is a good addition. Approving.
🤖 Generated with Claude Code
…mmandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efix, in both twins (commandprompt#1370 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…hing else down (commandprompt#1370 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…them and by the reader's column test removed (commandprompt#1370 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
|
Restated on main after #1374, so it's mergeable again: now 941082a. 🤖 Generated with Claude Code |
58fc64c to
941082a
Compare
jdatcmd
left a comment
There was a problem hiding this comment.
Verified 941082a against my approval of 58fc64c. It sits on current main (6f2031c), the patch is identical outside the count files, and no main row changes (2553 / 1962, ceiling 241). I'll merge once CI is green.
🤖 Generated with Claude Code
Part of #1341: the medium docs-claims item "expire treats a half declaration as no retention".
set_optionsaccepts attl_columnwithout attl_interval, or the reverse.PgColumnarReadTtlreads either alone as "no retention", soexpirerefuses with 55000 and drops nothing. No arm exercised either half.Arms (both twins; a new pytest function,
test_a_half_declaration_is_no_retention)Two tables, every row ten days old, so a reader that filled in the missing half would retire them all:
set_optionsstores a column-only declaration (ts|-) and an interval-only one (-|1 day).expirerefuses with55000, and all 3000 rows are still there.The mutation
The first idea, removing
!ivnullfrom the reader's test, dereferences a NULL interval and crashes. Instead, the mutant is the plausible defaulting bug: a missing interval is read as zero. PG17, main 8c61dff against this branch:The interval-only arm arrives never-red. Filling in a missing column would need a column name the table has, and I found no plausible mutation that does that without also breaking the column-only case first.
Evidence
cluster_tests533 → 534, which collides with test: expire refuses a non-owner, a non-time retention column and a dropped one, with rows it could drop (#1341) #1358's 534, so whichever lands second takes 535. Database-free set 429 passed.🤖 Generated with Claude Code