Skip to content

Conversation

@dverite
Copy link
Collaborator

@dverite dverite commented Apr 29, 2025

Allow intervals to change in an existing setup

dverite added 10 commits April 22, 2025 10:31
The provisioning applies the following method:

- Find the currently existing range [start,end]. No gap is allowed.
Only the bounds of the partitions are considered. The names are
ignored.

- Process "retention" by creating missing partitions before
"start", sized with the currently configured "interval".

- Process "preProvisioned" by creating missing partitions after
"end", sized with the currently configured "interval".

For both "retention" and "preProvisioned", add a shorter partition
when necessary, if the range to create does not divide evenly by
"interval". Short partitions are suffixed with YYYYMMDD_YYYYMMDD
representing the partition bounds.

Signed-off-by: Daniel Vérité <dverite@gmail.com>
…ment variable)

Signed-off-by: Daniel Vérité <dverite@gmail.com>
Instead of considering the partition names, determine the
range that should exist according to the configuration,
and remove the partitions that are entirely outside that range.

Signed-off-by: Daniel Vérité <dverite@gmail.com>
Signed-off-by: Daniel Vérité <dverite@gmail.com>
This DROP DATABASE sometimes fails for lack of permissions
when the FORCE needs to kill a session that it is
not allowed to kill.
Use a 5s lock timeout instead.

Signed-off-by: Daniel Vérité <dverite@gmail.com>
Signed-off-by: Daniel Vérité <dverite@gmail.com>
Signed-off-by: Daniel Vérité <dverite@gmail.com>
Non-continuous ranges in the initial state are now considered
an error.

Signed-off-by: Daniel Vérité <dverite@gmail.com>
Signed-off-by: Daniel Vérité <dverite@gmail.com>
Coverage is not actually reduced, but the tests are moved
to end-to-end.

Signed-off-by: Daniel Vérité <dverite@gmail.com>
@github-actions
Copy link

Code Coverage

Package Line Rate Health
github.com/qonto/postgresql-partition-manager/internal/infra/partition 5%
github.com/qonto/postgresql-partition-manager/internal/infra/postgresql 89%
github.com/qonto/postgresql-partition-manager/internal/infra/retry 100%
github.com/qonto/postgresql-partition-manager/internal/infra/uuid7 91%
github.com/qonto/postgresql-partition-manager/pkg/ppm 57%
Summary 55% (547 / 1001)

@dverite dverite merged commit cc54734 into main May 20, 2025
12 checks passed
@dverite dverite deleted the resizable-interval branch July 1, 2025 12:26
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.

3 participants