Hi,
When the archiver exits, currently reaper() restarts it only while
the postmaster state is PM_RUN. This is OK in 9.4 or before because
the archiver could be running on that state. But in 9.5, we can set
archive_mode to "always" and start the archiver even on the standby.
So I think that reaper() should restart the archiver even when
the postmaster state is PM_RECOVERY or PM_HOT_STANDBY with
some conditions. Patch attached.
Regards,
--
Fujii Masao
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index ee0b018..a4c677a 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -2810,7 +2810,10 @@ reaper(SIGNAL_ARGS)
if (!EXIT_STATUS_0(exitstatus))
LogChildExit(LOG, _("archiver process"),
pid, exitstatus);
- if (XLogArchivingActive() && pmState == PM_RUN)
+ if (wal_level >= WAL_LEVEL_ARCHIVE &&
+ ((pmState == PM_RUN && XLogArchiveMode > ARCHIVE_MODE_OFF) ||
+ ((pmState == PM_RECOVERY || pmState == PM_HOT_STANDBY) &&
+ XLogArchiveMode == ARCHIVE_MODE_ALWAYS)))
PgArchPID = pgarch_start();
continue;
}
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers