Skip to content

feat: a no-op expire answers from the column's extent, not a zone-map probe per group (#1310) - #1326

Merged
jdatcmd merged 6 commits into
commandprompt:mainfrom
OffgridwithJD:feat/1310-expire-extent
Oct 13, 2026
Merged

jdatcmd merged 6 commits into
commandprompt:mainfrom
OffgridwithJD:feat/1310-expire-extent

Conversation

@OffgridwithJD

@OffgridwithJD OffgridwithJD commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1310. #1325 has merged, so this is now rebased onto main (11f954e): six commits, starting at 0e32c6c.

What it does

This follows the plan you wrote on #1310. Most of the daemon's passes retire nothing, and expire proved that with one zone-map probe per row group. When the retention column's extent puts its minimum at or past the cutoff, no group's maximum is below it, so nothing can qualify, and expire returns 0 after one index lookup. Otherwise it decides group by group, as before. A column with no value at all has nothing to retire either. A too-wide extent only means no early exit; with no complete extent the loop runs as before.

Measured as zone-map scans for a no-op expire over 50 groups: 50 before, 0 after.

Arms, in both twins (the names match; the fixtures differ)

Mutations (PG17), each red on its own arms

mutation red
early exit removed (the tree before this PR) the no-op arm, the NULL arm
the extent's maximum compared instead of its minimum 14, including both "same groups" arms and 12 of the suite's existing arms
exit not taken for a column with no value the NULL arm
#1325's own-transaction fold removed "expire in the transaction that wrote aged rows"

Your two answers on #1304, applied

  • ttl_expire enters the ledger. All 67 checks are in, 16 dated by the four mutations, and no premise is dated. suites_not_covered goes 247 → 246, and the census goes 1745 → 1796 over 2259 rows. The gate gives rc=0.
  • premise: expire retired the three aged groups is now an arm, in both twins (expire retired the three aged groups). The max-for-min mutation reddens it.

Evidence

🤖 Generated with Claude Code

jdatcmd and others added 6 commits October 13, 2026 13:20
…ommandprompt#1310)

Seen red on PG17: fifty groups, fifty zone_map scans. The guards beside it
are green on this tree: without the extent it still probes every group, with
it the same groups retire, and aged rows written in expire's own transaction
are retired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-map probe per group (commandprompt#1310)

When the retention column's extent puts its minimum at or past the cutoff, no
group's maximum is below it, so nothing can qualify. Built on commandprompt#1304 option 5,
whose bound includes the transaction's own flushed groups. ttl_expire.sh
65/65 on PG17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… with only NULLs

The twin was seen red on PG17 against the tree before the early exit: forty
groups, forty zone_map scans. The NULL arm was written after the code and is
dated by a mutation of the !hasValues clause, not by the red-first run.
Check names carry no counts, since the twins' fixtures differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…commandprompt#1236)

A mutation of expire's early exit (the extent's maximum compared instead of
its minimum) reddens it, so it measures the code under test. Renamed in both
twins, at jdatcmd's request on commandprompt#1304.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions (commandprompt#1310)

ttl_expire.sh 67/67 and test_ttl_expire.py 9/9 on each of PG15-19. Seeded at
jdatcmd's request on commandprompt#1304; suites_not_covered 247 -> 246. Ledger 2162 / 1756.
cluster_tests 518 -> 519 by collection. TESTS.md and CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e planner's

The same out-parameter shape gcc 13/14 with LTO reported as maybe-uninitialized
on commandprompt#1325; emin and emax are read only when hasValues is true.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OffgridwithJD
OffgridwithJD force-pushed the feat/1310-expire-extent branch from 6e81d07 to 4fd0480 Compare October 13, 2026 13:20
@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

@jdatcmd #1325 merged, so this is rebased onto 11f954e. It is now just this PR's six commits, at 4fd0480. The tree is byte-identical to the one verified at 6e81d07 (git diff is empty), because main at 11f954e equals 3c71b6a. That earlier verification gave, on PG17: ttl_expire 67/67, column_extent 36/36, both twins 16/16, and the gate rc=0. Over 15–19, ttl_expire gave 67/67 and its twin 9/9. Ready for your review.

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

Approved at 4fd0480. Merging when CI is green on this head.

The early exit is sound. The loop retires a group only when its maximum is strictly below the cutoff (c < 0). Every group's maximum is at least the extent's minimum, so min >= cutoff means no group can qualify, and that includes the case where they are equal. A column with no values exits too, and the loop agrees: it skips every group without a min/max. The same active snapshot serves the extent and the loop, and a too-wide extent costs only the early exit.

The ledger is right. Main's 2192 rows are unchanged. ttl_expire enters with 67 rows: 2259 in all, of which 1796 are never red, matching the budget. suites_not_covered goes from 247 to 246. The renamed premise is now an arm, and a mutation is what dates it (#1236).

The twins match. Both carry the six new or renamed checks with identical names, and the pytest file states it is independent of ttl_expire.sh.

I checked this by reading and by the ledger arithmetic. I did not run the suites locally; CI's suites jobs are the run.

@jdatcmd
jdatcmd merged commit 4c72242 into commandprompt:main Oct 13, 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.

expire reads a column's zone maps in one catalog scan, not one per row group

2 participants