Repository navigation
test: expire refuses a non-owner, a non-time retention column and a dropped one, with rows it could drop (#1341) - #1358
Conversation
jdatcmd
left a comment
There was a problem hiding this comment.
Approving the content at d2d1fe7. On PG17 I reproduced the owner claim with PgColumnarRequireTableOwnerByOid removed from pgcolumnar_expire:
- main: ttl_expire passes 70/70.
- this head: "a role that does not own the table cannot expire it, even holding DELETE (42501): got [|0] want [42501|3000]". The non-owner retired every row, as you say.
Keeping the owner's control on its own table (ttl_ctl) is the right fix for the collateral red. Leaving the half-declaration item until there is a non-crashing proof is the right call too.
Needs a rebase before merge. Main is 1933577, with #1353 and #1355 in, which share ttl_expire.sh and test_ttl_expire.py. That gives:
- Ledger: 2343 / 1796, so with your seven rows (three dated) I expect 2350 / 1800.
- Count:
cluster_testsis now 533, so yours goes to 534.
Restate both from a recount and a collection, and I'll check and merge.
…ropped one, with rows it could drop, in both twins (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the refusal it controls (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@jdatcmd, rebasing onto c558971 now. #1353 and #1355 changed both ttl files since this PR's evidence. The test files auto-merged; |
commandprompt#1353 and commandprompt#1355 (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@jdatcmd, rebased onto c558971. The new head is cc5557b, replacing d2d1fe7. Ledger: 2361 / 1801,
I'll ping on green CI. |
d2d1fe7 to
cc5557b
Compare
jdatcmd
left a comment
There was a problem hiding this comment.
Re-approving cc5557b.
- Ledger: a recount gives 2361 / 1801, which agrees with the budget. No duplicate keys, no dated
premise:row. - Patch: the
ttl_expirechanges are the same 125 lines as d2d1fe7, the head I reviewed and reproduced, rebased around #1353 and #1355. - Counts:
cluster_tests534 by collection; the database-free set gives 429 passed.
Merging.
Part of #1341: the High expire items. They are a non-owner refused, and a retention column that is not a time type (42804) or no longer exists (42703). Arms are in both twins, plus a new pytest function,
test_expire_refuses_what_it_cannot_honour.The fixture makes a missing refusal destructive
Every refused table holds 3,000 rows, ten days old, in three row groups, under a one-day retention. Each arm asserts the SQLSTATE and the row count, so "refused" means nothing was dropped.
The owner's control runs on its own identical table (
ttl_ctl). On the first draft it sharedttl_own: under the no-owner mutant the non-owner had already dropped the rows, so the control reddened as collateral.pgc_ledger mergerefused to record that, rightly.Arms and mutations
PG17, both twins, main 8af86e8 against this branch:
pgcolumnar_expirePgColumnarRequireTableOwnerByOidremovedThe fourth row is a real gap made visible: without the owner check, a role that holds only DELETE could drop whole row groups of a table it doesn't own.
There are four never rows:
set_optionsaccepting an int column, which is what makes the refusal expire's job;Not done here: the half-declaration item. Removing
PgColumnarReadTtl's both-halves test dereferences a NULL interval, so the only mutant crashes the backend. I'd rather design a non-crashing proof than date an arm with a segfault.Evidence
cluster_tests532 → 533. test: ttl_expire, the #1339 findings in both twins: a timestamp column, a zone that always differs, accurate premises #1353 also takes 533, so whichever lands second goes to 534.🤖 Generated with Claude Code