Repository navigation
feat: report rows in DEFAULT that no maintenance run would reach - #94
Merged
Merged
Conversation
A row written with a key outside every partition after adoption lands in DEFAULT, and if its window is behind the cursor nothing ever comes back for it: no apply creates that window again, retention cannot drop it, and plan said there was nothing to do. Outpost's publish API takes a client-supplied time, which is how its maintainer found it. plan now reports it as rows_in_default (WARNING), so plan --check exits 3 and apply carries it in result.issues; backfill moves the rows into a partition of their own. The earliest row in DEFAULT decides, read with the index probe partition_data already uses: rows of a window the same plan creates are left to its attach, and rows ahead of the cursor to the run that reaches them. ActualTree.default_earliest carries it.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From alexluong's review of the Outpost recipe (hookdeck/outpost#1110): Outpost's publish API accepts a client-supplied
time, so after adoption an event dated in a month with no partition lands inevents_default. He inserted one dated 2025-06 and one in a month retention had already dropped.plan --checksaid "nothing to do" and exited 0, andapply --allow-destructiveleft both rows where they were. Creation walks forward from the cursor, so no run ever came back for that window, and retention can't drop rows that were never in a partition.plannow reports this asrows_in_default(WARNING):plan --checkexits 3, andapplycarries the finding inresult.issues.backfillalready moves such rows into a partition of their own.The earliest row in DEFAULT decides whether to report. It is read with the same index probe
partition_datauses (get_leading_key_minimum), so the provider protocol doesn't change. A row in a window the same plan creates is moved by that plan's attach, and a row dated ahead of the cursor is moved by the run that reaches its window, so neither is reported. That keeps an ordinary adoptionapplyfrom warning about the current month it is about to attach. The history thatbackfillhasn't moved yet is reported until it has, and the docs say so.ActualTree.default_earliestcarries the value.Tests:
planreports it,partition_datamoves it, andplanis clean again. With the planner call removed, the integration test fails.Results: unit 2871 passed, integration (PG 17) 575 passed, ruff and mypy clean, docs build clean.