Re: [ADMIN] does wal archiving block the current client

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Frost <jeff(at)frostconsultingllc(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [ADMIN] does wal archiving block the current client
Date: 2006-05-23 14:49:15
Message-ID: 1148395755.2646.825.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Fri, 2006-05-19 at 17:27 +0100, Simon Riggs wrote:
> On Fri, 2006-05-19 at 12:03 -0400, Tom Lane wrote:
> > Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> > > OK, I'm on it.
> >
> > What solution have you got in mind? I was thinking about an fcntl lock
> > to ensure only one archiver is active in a given data directory. That
> > would fix the problem without affecting anything outside the archiver.
> > Not sure what's the most portable way to do it though.
>
> I was trying to think of a better way than using an archiver.pid file in
> pg_xlog/archive_status...

Yesterday I posted to -patches with a new archiver.pid interlock
mechanism. This will prevent server startup when the archiver is first
activated, but once running will clean up and restart again.

This doesn't quite get to the nub of the problem: archiver is designed
to keep archiving files, even in the event that the postmaster explodes.
It will keep archiving until they're all gone.

My recent patch will prevent server startup, so if you do a fast restart
to bounce the server and change parameters you'll have to keep the
server down while the archiver completes (or you kill it).

The archiver's Spartan diligence is great if postmaster does fail, but
archiver can't tell the difference between a normal shutdown and a
postmaster crash. If the postmaster sent a SIGUSR2 on normal shutdown,
we would be able to interrupt the outer loop and shutdown much faster. A
starting postmaster might then reasonably wait a little while for the
old archiver to quit before starting the new one.

What do you think?

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-05-23 14:53:47 Re: [ADMIN] does wal archiving block the current client connection?
Previous Message Michael Fuhr 2006-05-23 14:30:55 Re: Howto get tranaction rate in postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-23 14:53:47 Re: [ADMIN] does wal archiving block the current client connection?
Previous Message Dave Cramer 2006-05-23 14:42:20 Re: Performance Issues