pgsty / pgsty/pigsty

Bootstrapping a standby cluster using pgBackRest

Open
#733 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
5.7k
Forks
384
Avg merge
2h 36m
Merged PRs (30d)
2

Description

Pigsty sets create_replica_methods key in standby_cluster section to basebackup only. Can pgbackrest be supported too?

https://github.com/pgsty/pigsty/blob/c4ddba79c4e5897676740221e79a7d833168139a/roles/pgsql/templates/oltp.yml#L215-L217

Implementation notes
  1. A standby cluster needs to restore from the upstream cluster's stanza during its bootstrap, which is different from {{ pg_cluster }} used by cascade replicas replicating from standby leader.
  2. restore_command of the standby leader should bet set to pgbackrest archive-get with the upstream cluster's stanza, in case some WAL segments on the upstream primary have been recycled during restore and could not be received via streaming replication.

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 roles/pgsql/templates/oltp.yml around the standby_cluster create_replica_methods setting and read Patroni's custom replica creation documentation. Trace how the standby leader's restore_command is configured and how the upstream stanza differs from {{ pg_cluster }}. Done means a standby cluster can bootstrap from pgBackRest while retaining the required upstream WAL retrieval behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.