pgsql: Archive timeline history files in standby if archive_mode is set

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Archive timeline history files in standby if archive_mode is set
Date: 2020-09-29 07:26:59
Message-ID: E1kNA2N-0001GK-Ht@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Previously the standby server didn't archive timeline history files
streamed from the primary even when archive_mode is set to "always",
while it archives the streamed WAL files. This could cause the PITR to
fail because there was no required timeline history file in the archive.
The cause of this issue was that walreceiver didn't mark those files as
ready for archiving.

This commit makes walreceiver mark those streamed timeline history
files as ready for archiving if archive_mode=always. Then the archiver
process archives the marked timeline history files.

Back-patch to all supported versions.

Reported-by: Grigory Smolkin
Author: Grigory Smolkin, Fujii Masao
Reviewed-by: David Zhang, Anastasia Lubennikova
Discussion: https://postgr.es/m/54b059d4-2b48-13a4-6f43-95a087c92367@postgrespro.ru

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/462ff7966997301de3ce469b1034a0aba44957c1

Modified Files
--------------
doc/src/sgml/high-availability.sgml | 3 ++-
src/backend/replication/walreceiver.c | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2020-09-29 07:27:12 pgsql: Archive timeline history files in standby if archive_mode is set
Previous Message Fujii Masao 2020-09-29 07:26:44 pgsql: Archive timeline history files in standby if archive_mode is set