Reputation: 3896
Environment: Postgresql 13.x
(dockerized)
I was trying to test the DR setup for PostgreSQL nodes. pg_basebackup and wal_files archive was taken from the standby mode.
Done restoration on a new node by copying pg_basebackup
and configured postgresql.conf
to use restore_command
pointing to walfiles archive.
#----------------------- RECOVERY CONFIGS -----------------------
restore_command = 'cp /db-restore/mydb/walfiles/%f "%p"'
recovery_target_timeline = 'latest'
recovery_target_action = promote
select
queries returning correct results.2022-04-19 10:19:53 UTC [291] rep_usr@[unknown] ERROR: replication slot "slot_name" does not exist
2022-04-19 10:19:58 UTC [296] rep_usr@[unknown] ERROR: replication slot "slot_name" does not exist
As I have taken backup from standby, is this restoration making new node as a standby and looking for the replication_slot
it used in the previous generation?
How can I make new node as a Master (remove replication_slot info)
What are the proper steps to recover if the backup was taken from standby.
I have 1 master and 2 standby nodes. And planning to take a backup from a standby. So is there any specific changes required for archive_mode
and archive_command
when using this on a standby node? Current commands:
archive_mode = always
archive_level = logical
archive_command = 'test ! -f /db-archives/walfiles/%f && cp %p /db-archives/walfiles/%f'"
Could someone help with this? Any pointers?
I am sure, db-backup will have info about replication_slot and connection_info as the pg_basebackup
itself is a clone of entire DB. To revert configs, I am manually removing postgresql.auto.conf
in main
directory which contains above parameters.
replication_slot
if there are any in the DB backup?Upvotes: 3
Views: 8208
Reputation: 3896
I removed all configs and started with fresh.
main/postgresql.auto.conf
which was present in the backup.main/postgresql.auto.conf
is present in standby nodes when we take pg_basebackup
. contains the configs used for pg_basebackup in standby nodes. (slot_name, and connect_info).As I was restoring backup from standby to a Master, I don't need that postgresql.auto.conf
.
Upvotes: 1
Reputation: 246013
These error messages don't seem to be thrown by recovery, but by some other tool that connects as database user rep_usr
.
Create the replication slot if your application needs it!
Upvotes: 0