1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-02-02 13:36:08 +02:00

[Issue #134] do not backup "recovery.signal" and "standby.signal" files, and for PG12 and newer always set recovery_target_timeline to current

This commit is contained in:
Grigory Smolkin 2019-10-18 19:42:02 +03:00
parent 19ad13d777
commit ff40fcc4be
2 changed files with 13 additions and 0 deletions

View File

@ -80,6 +80,8 @@ static char *pgdata_exclude_files[] =
"postmaster.pid",
"postmaster.opts",
"probackup_recovery.conf",
"recovery.signal",
"standby.signal",
NULL
};

View File

@ -967,6 +967,17 @@ create_recovery_conf(time_t backup_id,
if (rt->target_tli)
fio_fprintf(fp, "recovery_target_timeline = '%u'\n", rt->target_tli);
else
{
/*
* In PG12 default recovery target timeline was changed to 'latest', which
* is extremely risky. Explicitly preserve old behavior of recovering to current
* timneline for PG12.
*/
#if PG_VERSION_NUM >= 120000
fio_fprintf(fp, "recovery_target_timeline = '%u'\n", backup->tli);
#endif
}
if (rt->target_action)
fio_fprintf(fp, "recovery_target_action = '%s'\n", rt->target_action);