Re: Revised patch for fixing archiver shutdown behavior

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-patches(at)postgreSQL(dot)org, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Revised patch for fixing archiver shutdown behavior
Date: 2008-01-10 15:13:11
Message-ID: 5382.1199977991@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Something I'm still wondering is about the archiver/logger combination.
> What happens if a postmaster is stopped by the user and the archiver is
> still running, and the user starts a new postmaster? This would launch
> a new archiver and logger; and there are now two loggers possibly
> writing to the same files, and truncated log lines could occur.

I'm not nearly as worried about that as I am about the prospect of
two concurrent archivers :-(

There was discussion of having a lock file for the archiver, but
it's still an open issue. I'm not sure how to solve the problem
of stale lockfiles --- unlike the postmaster, the archiver can't
assume that it's the only live process with the postgres userid.
For example, after a system crash-and-restart, it's entirely
likely that the PID formerly held by the archiver is now held
by the bgwriter, making the lockfile (if any) look live.

Maybe we should go back to the plan of having the postmaster
wait for the archiver to exit.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Hiroshi Saito 2008-01-10 15:15:53 Re: reference problem of manifest.(win32.mak of libpq.dll)
Previous Message Magnus Hagander 2008-01-10 15:08:29 Re: reference problem of manifest.(win32.mak of libpq.dll)