Repository navigation
feat: check fails when a hypertable keeps too many chunks or declares no retention - #40
Open
systemfsoftware-bot wants to merge 3 commits into
Open
systemfsoftware-bot wants to merge 3 commits into
systemfsoftware-bot wants to merge 3 commits into
Conversation
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.
Stacked on #39 (it reuses that PR's interval reader); retarget to
mainwhen #39 merges.timescale-drizzle checknow also reads the hypertable declarations and fails when one can keep too many chunks. Each chunk and its indexes cost a lock in any query that cannot exclude it.ceil(dropAfter / chunkTimeInterval)(7 days when unset), timesnumberPartitionsfor a space partition.dropCreatedBeforecounts the same way. Limit 500,--max-chunks <n>to change it.retentionfails unless the table declaresretention: 'unbounded'(which creates no policy).retention: 'unbounded'plusexpectedHistory: '3 years':checkcountsceil(expectedHistory / chunkTimeInterval)against the limit.expectedHistoryis declared, not measured, andcheckis the only reader. Without it the table passes with a note, because no count can be computed without guessing.expectedHistorywithout'unbounded'is a declaration error.Run on six declarations (scratch script, not in the diff): 1-day interval with 10 years retention reports 3650 chunks; 14 days over 90 days passes; no retention fails; unbounded with no history gives the note; unbounded 1-day over 3 years reports 1095; 30-day over 3 years passes.
Typecheck, lint and format pass. No tests added.
Limits stated in the README: months count 30 days and years 365;
dropCreatedBeforefollows chunk creation time, so a backfill keeps more than the formula says; compressed-chunk tables are not counted; continuous aggregates are not checked.Gemini review: space partitions omitted (fixed); no guard on the limit passed to the exported function (fixed). Not taken: conservative month/year bounds, a
scheduleInterval+ 1 boundary chunk (the formula is the one specified), columnstore doubling. Its claim thatdropAfterplusdropCreatedBeforeis accepted is wrong:readRetentionalready rejects it.