Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support standby.signal file to mark postgres 12+ instances as replicas #1571

Open
gavinwill opened this issue Jan 30, 2024 · 0 comments
Open

Comments

@gavinwill
Copy link

Use Case

Currently this role supports recovery.conf to configure a server to be a replica. As of postgresql 12+ recovery.conf has been removed and instead requires an empty file standby.signal to be in the data directory to mark the server as a replica.

it will then look to the config file to obtain settings such as primary_conninfo and restore_command amongst others to talk to upstream server for replication

Describe the Solution You Would Like

An option to mark postgresql 12+ servers as replicas with an option to tag replica=true or similar

Describe Alternatives You've Considered

Using the simple instance_directories functionality i tried to add the file

# “standby.signal” — which is an empty file—has replaced the recovery.conf file # and the presence of this file will signal to the cluster to run in standby / replica mode. #"/var/lib/postgresql/14/mydatabase/standby.signal": # ensure: file # owner: postgres # group: postgres

This works fine for an existing database and we can see that the output of pg_lsclusters shows as online,recovery howere on a fresh install and Init db the file is placed before init.db is run and then init.db complains that it cant initialise the database because the data dir is not empty (because standby.signal is in there)

Additional Context

Happy to make a PR - currently just wanted to log the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants