history file on replica and double switchover

Grigory Smolkin <g.smolkin@postgrespro.ru>

From: Grigory Smolkin <g.smolkin@postgrespro.ru>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-08-27T13:02:44Z
Lists: pgsql-hackers

Attachments

Hello!

I`ve noticed, that when running switchover replica to master and back to 
replica, new history file is streamed to replica, but not archived,
which is not great, because it breaks PITR if archiving is running on 
replica. The fix looks trivial.
Bash script to reproduce the problem and patch are attached.

-- 
Grigory Smolkin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Archive timeline history files in standby if archive_mode is set to "always".