Repository navigation
feat: an expired partition stays detached for a week unless the policy names a drop - #113
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…y names a drop A LifecyclePolicy without drop= (every flat config, every bare TablePartitionConfig, every YAML table without drop:) used DropAfter() with no grace, so an expired partition was detached and dropped in the same run and a wrong retention lost the data at once. The default is now DropAfter(grace=timedelta(days=7)). An explicit DropAfter() keeps its zero grace; DropNever() is unchanged. Closes #106
AlexeyShalaev
force-pushed
the
feat/106-default-drop-grace
branch
from
October 16, 2026 20:33
d9a7b1c to
535fe8d
Compare
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.
Closes #106.
A
LifecyclePolicythat doesn't namedrop=now getsDropAfter(grace=timedelta(days=7))instead ofDropAfter()(DEFAULT_DROP_GRACE_DAYSinconstants.py). That covers every flat config, every bareTablePartitionConfig(...)and every YAML table withoutdrop:. An explicitDropAfter()keeps its zero grace, andDropNever()is unchanged. So only configurations that never chose a drop behave differently, and the difference is that disk is freed a week later.Ships as
feat:(1.9.0), not!: no API changes, and the new default only delays a destructive step. The changelog entry says who notices.Docs:
TablePartitionConfigdocstring says where the drop is chosen;--locksexample no longer show a DROP in the same run as the detach.Tests:
tests/integration/nested_support.py, the scenario builder and two local builders) now spell outDropAfter()through a smalldrops_at_oncedecorator. It leaves a config alone when its policy names a drop itself, so the grace tests still test the grace.drop: {kind: drop_after, grace: P0D}.Results: unit 2872 passed, integration (PG 17) 577 passed, ruff and mypy clean, docs build clean.