mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Cause the archiver process to adopt new postgresql.conf settings (particularly
archive_command) as soon as possible, namely just before issuing a new call of archive_command, even when there is a backlog of files to be archived. The original coding would only absorb new settings after clearing the backlog and returning to the outer loop. Per discussion. Back-patch to 8.3. The logic in prior versions is a bit different and it doesn't seem worth taking any risks of breaking it.
This commit is contained in:
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.40 2009/06/11 14:49:01 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.40.2.1 2010/05/11 16:42:33 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -410,14 +410,6 @@ pgarch_ArchiverCopyLoop(void)
|
|||||||
{
|
{
|
||||||
char xlog[MAX_XFN_CHARS + 1];
|
char xlog[MAX_XFN_CHARS + 1];
|
||||||
|
|
||||||
if (!XLogArchiveCommandSet())
|
|
||||||
{
|
|
||||||
ereport(WARNING,
|
|
||||||
(errmsg("archive_mode enabled, yet archive_command is not set")));
|
|
||||||
/* can't do anything if no command ... */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* loop through all xlogs with archive_status of .ready and archive
|
* loop through all xlogs with archive_status of .ready and archive
|
||||||
* them...mostly we expect this to be a single file, though it is possible
|
* them...mostly we expect this to be a single file, though it is possible
|
||||||
@ -440,6 +432,25 @@ pgarch_ArchiverCopyLoop(void)
|
|||||||
if (got_SIGTERM || !PostmasterIsAlive(true))
|
if (got_SIGTERM || !PostmasterIsAlive(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check for config update. This is so that we'll adopt a new
|
||||||
|
* setting for archive_command as soon as possible, even if there
|
||||||
|
* is a backlog of files to be archived.
|
||||||
|
*/
|
||||||
|
if (got_SIGHUP)
|
||||||
|
{
|
||||||
|
got_SIGHUP = false;
|
||||||
|
ProcessConfigFile(PGC_SIGHUP);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* can't do anything if no command ... */
|
||||||
|
if (!XLogArchiveCommandSet())
|
||||||
|
{
|
||||||
|
ereport(WARNING,
|
||||||
|
(errmsg("archive_mode enabled, yet archive_command is not set")));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pgarch_archiveXlog(xlog))
|
if (pgarch_archiveXlog(xlog))
|
||||||
{
|
{
|
||||||
/* successful */
|
/* successful */
|
||||||
|
Reference in New Issue
Block a user