1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-28 11:44:57 +03:00

Add archive_mode='always' option.

In 'always' mode, the standby independently archives all files it receives
from the primary.

Original patch by Fujii Masao, docs and review by me.
This commit is contained in:
Heikki Linnakangas
2015-05-15 18:55:24 +03:00
parent f6d65f0c70
commit ffd37740ee
9 changed files with 133 additions and 29 deletions

View File

@@ -480,7 +480,10 @@ KeepFileRestoredFromArchive(char *path, char *xlogfname)
* Create .done file forcibly to prevent the restored segment from being
* archived again later.
*/
XLogArchiveForceDone(xlogfname);
if (XLogArchiveMode != ARCHIVE_MODE_ALWAYS)
XLogArchiveForceDone(xlogfname);
else
XLogArchiveNotify(xlogfname);
/*
* If the existing file was replaced, since walsenders might have it open,