aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-05-30 17:08:14 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-05-30 17:08:14 +0000
commit3993bd8e07a31dd3b4606a53cc02627da7ed769c (patch)
tree622fe9ceaf2d3d784b1115a6ee5cfc2cebd6c7c0 /src
parent03f963640fd02fa297a7bc30b8c8f4ac1f84b1ce (diff)
downloadpostgresql-3993bd8e07a31dd3b4606a53cc02627da7ed769c.tar.gz
postgresql-3993bd8e07a31dd3b4606a53cc02627da7ed769c.zip
PostmasterIsAlive test really ought to be in the inner loop for safety.
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/pgarch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c
index 3b6cc9d5d97..9a8f24e5dbb 100644
--- a/src/backend/postmaster/pgarch.c
+++ b/src/backend/postmaster/pgarch.c
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.21 2006/05/30 13:30:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.22 2006/05/30 17:08:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -352,12 +352,16 @@ pgarch_ArchiverCopyLoop(void)
* some backend will add files onto the list of those that need archiving
* while we are still copying earlier archives
*/
- while (PostmasterIsAlive(true) && pgarch_readyXlog(xlog))
+ while (pgarch_readyXlog(xlog))
{
int failures = 0;
for (;;)
{
+ /* Abandon processing if we notice our postmaster has died */
+ if (!PostmasterIsAlive(true))
+ return;
+
if (pgarch_archiveXlog(xlog))
{
/* successful */