zalando / zalando/postgres-operator

Spread BACKUP_SCHEDULE

Open
#2,465 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.2k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
3

Description

We currently deploy around 80 postgres instances with this env var:

  - name: BACKUP_SCHEDULE
    value: 0 */6 * * *

We notice a cpu/disk/network spike around that time.

It would be nice if there was a feature to spread this "every 6 hours" cron.

For instance, we could have a new env var that would be something like:
BACKUP_SCHEDULE_SPREAD_HOURLY=true

If if true, would put rand(0, 59) in the first cron value.

https://github.com/zalando/spilo/blob/d554db0d02806342123fc6a143fd84494c53ca9b/postgres-appliance/scripts/configure_spilo.py#L996-L998

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with spilo/postgres-appliance/scripts/configure_spilo.py around lines 996-998 and trace how BACKUP_SCHEDULE is handled. Define the new environment-variable behavior and verify that enabled instances receive spread backup times while the existing schedule remains unchanged when it is not enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.