Question regarding failover behavior - Mailing list pgsql-general

From Koen De Groote
Subject Question regarding failover behavior
Date
Msg-id CAGbX52H23OoYzoUM+nR+qx0_8vNi3a1H8GA-UtCy666qbuGHQQ@mail.gmail.com
Whole thread Raw
Responses Re: Question regarding failover behavior
List pgsql-general
Hello all,

I have a system that was originally set up on 9.3, a few years ago moved to 11.2

A shared mount is used to host the basebackup and wal archives.

The failover procedure was basically manual and as follow:

1/ Take out the primary, remove the IP from the primary machine/VM
2/ Create the trigger_file on the standby, add the IP to the new primary machine/VM
3/ Create a basebackup from the new primary
4/ Redeploy the new standby, which will unpack this basebackup from step 3
5/ The new standby will have a restore_command to get synced back up.

I see there's more recent tools like pg_rewind these days. Haven't had time to check that out and probably won't for a while.

My question is: is the basebackup actually necessary? Can I not simply modify the configuration old the old primary, set it up like a standby, and then start the process/container, and have it pick up the necessary wal_archives with the restore_command?

Or is it more complicated than that? Something like a timeline jump or something else that makes it impossible to simply set the old primary to standby and start it again?

Kind regards,
Koen De Groote

pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Setting up a server with previous day data
Next
From: Bryn Llewellyn
Date:
Subject: Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario