partition-manager v0.4.0
Partition Manager v0.4.0 adds a drop
command that produces ALTER TABLE ... DROP PARTITION IF EXISTS ...
statements ready for execution, obeying a retention policy set in the configuration file.
The policy is set per table
as such:
partitionmanager:
tables:
certificates:
retention_period:
days: 90
Or can be set globally as:
partitionmanager:
partition_period:
days: 30
If both are set, the table-level policy supersedes.
Behavior Changes
- Prometheus statistics are no longer are emitted for tables not in the configuration file
- Empty tables no longer are marked as ALTER errors in Prometheus statistics
Packaging
This release of Partition Manager is only released as a source tarball or a Python wheel file. .deb
files are no longer packaged in this project.
What's Changed
- Prevent potential supply chain attack by referencing a commit rather than @latest in GH action by @pgporada in #65
- Retention-based Partition Dropping by @jcjones in #44
- Fix typos discovered by codespell by @cclauss in #71
- pre-commit autoupdate && pre-commit run --all-files by @cclauss in #69
- Keep GitHub Actions up to date with GitHub's Dependabot by @cclauss in #74
- Replace black and flake8 with ruff by @cclauss in #75
- Switch to pyproject.toml from setup.py by @jcjones in #73
- Bump the github-actions group with 3 updates by @dependabot in #76
- Ruff format --line-length=88 by @cclauss in #82
- Don't emit a Prometheus error for empty tables by @jcjones in #80
- Use timezone-aware datetimes -- ruff check --select=DTZ by @cclauss in #84
- Use comprehensions -- ruff check --select=C4 by @cclauss in #83
- Don't emit metrics for tables not in the config file by @jcjones in #78
- Refactor
do_partition
to reduce the statement count by @jcjones in #81
New Contributors
- @cclauss made their first contribution in #71
- @dependabot made their first contribution in #76
Future Notes
Partition Manager v1.0.0 will stop using partition names to determine partition ages, instead requiring every monitored table to provide a SQL query to resolve partition boundaries. This will break configurations that do not set earliest_utc_timestamp_query
for each table.
Partition Manager then will stop keeping names up-to-date, and switch to using partition names that don't attempt to convey temporal meaning.
This is going to simplify a lot of the Partition Manager code, which all assumes that the partition names must be cared for as metadata.
Full Changelog: v0.3.6...v0.4.0