Closed djtaylor closed 2 years ago
I figured this out a few minutes after I posted this. When you create the standby cluster, it needs to have restore mode enabled for it to properly sync with the master:
Spec:
Backups:
Pgbackrest:
Restore:
Enabled: true
Repo Name: repo1
When this restore option is set, the standby cluster will properly initialize and become healthy. Afterwards you can patch to disable restore mode.
Overview
This may be simply a lack in documentation for this particular scenario, as I can't seem to find anywhere how to handle this situation. We have two clusters in different datacenters, with data replicated to the standby by way of S3. After performing an in-place PITR on the master (which everything works), I want to make sure its state is reflect in the standby cluster. I delete and recreate the standby cluster to attempt to force it to sync with the current state of the primary after the in-place PITR was done. The standby cluster fails to properly bootstrap/initialize.
Environment
Kubernetes
1.18.18
)ubi8-5.0.4-0
13
s3
Steps to Reproduce
1.) Have an environment with 2 clusters, one primary and one standby. Use S3 to replicate from primary to standby 2.) Perform an in-place PITR recovery on the primary as described in: https://access.crunchydata.com/documentation/postgres-operator/5.0.4/tutorial/disaster-recovery/ 3.) After primary is healthy again, delete the standby and recreate from a blank state 4.) Observe the state of the pods failing to initialize
EXPECTED
ACTUAL
database
containers never become healthyLogs
Extract from one of the standby database containers that is failing to initialize:
Additional Information
Standby cluster YAML:
It would be valuable to know (and document) what steps need to be taken to ensure a standby cluster, replicated from the primary via S3, is properly synced with the primary after an in-place PITR.