Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

pgbackrest container can't start when running on slave pod #83

Closed
lonelyleaf opened this issue Dec 23, 2019 · 2 comments
Closed

pgbackrest container can't start when running on slave pod #83

lonelyleaf opened this issue Dec 23, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@lonelyleaf
Copy link

When using backup featuer in helm chart,only the master pod's pgbackrest container can
start up , the log of slave container is like below:

ERROR: [027]: primary database not found
       HINT: check indexed pg-path/pg-host configurations
2019-12-23 06:34:28 - bootstrap - Creating pgBackrest stanza
INFO: stanza-create command begin 2.19: --compress-level=3 --config=/etc/pgbackrest/pgbackrest.conf --log-level-stderr=info --pg1-path=/var/lib/postgresql/data --pg1-port=5432 --pg1-socket-path=/var/run/postgresql --repo1-cipher-type=none --repo1-path=/timescaledb-single/pg-test --repo1-s3-bucket=timescaledb-backup --repo1-s3-endpoint=minio.haorun.win --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-2 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=poddb
ERROR: [056]: unable to find primary cluster - cannot proceed
INFO: stanza-create command end: aborted with exception [056]

I checked the issues of pgbackrest pgbackrest/pgbackrest#878, so by default only the master db can be backup.

But in a statefuleset ,when pgbackrest fail to start the service timescaledb-single-replica won't have available endpoints,causing conneting to slave is imposiable

@feikesteenbergen feikesteenbergen added the bug Something isn't working label Dec 31, 2019
feikesteenbergen added a commit that referenced this issue Jan 17, 2020
The check command of pgBackRest used to succeed on the replica, but this
behaviour changed recently [1] and will be ok in the long term.

This commit is a workaround for this change, and will only check the
backup stanza when running as primary.

Addresses issues #83 and #93

1: pgbackrest/pgbackrest#878
feikesteenbergen added a commit that referenced this issue Jan 17, 2020
The check command of pgBackRest used to succeed on the replica, but this
behaviour changed recently [1] and will be ok in the long term.

This commit is a workaround for this change, and will only check the
backup stanza when running as primary.

Addresses issues #83 and #93

1: pgbackrest/pgbackrest#878
feikesteenbergen added a commit that referenced this issue Jan 21, 2020
The check command of pgBackRest used to succeed on the replica, but this
behaviour changed recently [1] and will be ok in the long term.

This commit is a workaround for this change, and will only check the
backup stanza when running as primary.

Addresses issues #83 and #93

1: pgbackrest/pgbackrest#878
@feikesteenbergen
Copy link
Member

@lonelyleaf We fixed this in the latest release (1.5.1), could you verify that it is solved for you now?

@tomislater
Copy link

It is still not solved (0.9.0):

# slave
➜ kubectl exec -ti pod/timescaledb-0 --namespace timescaledb -c pgbackrest -- pgbackrest stanza-create
ERROR: [056]: unable to find primary cluster - cannot proceed
command terminated with exit code 56

# slave
➜ kubectl exec -ti pod/timescaledb-1 --namespace timescaledb -c pgbackrest -- pgbackrest stanza-create
ERROR: [056]: unable to find primary cluster - cannot proceed
command terminated with exit code 56

# master
➜ kubectl exec -ti pod/timescaledb-2 --namespace timescaledb -c pgbackrest -- pgbackrest stanza-create

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants