pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Frost <jeff@frostconsultingllc.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: does wal archiving block the current client connection?
Date: Fri, 19 May 2006 11:59:19 -0400
Message-ID: <679.1148054359@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.64.0605190852160.7012@discord.home.frostconsultingllc.com>
References: <Pine.LNX.4.64.0605150914360.9581@discord.dyndns.org>
	<Pine.LNX.4.64.0605151554000.9581@discord.dyndns.org>
	<1147781287.2646.32.camel@localhost.localdomain>
	<Pine.LNX.4.64.0605161119330.3380@glacier.frostconsultingllc.com>
	<15699.1147840569@sss.pgh.pa.us>
	<1147858398.2646.150.camel@localhost.localdomain>
	<19436.1147874478@sss.pgh.pa.us>
	<Pine.LNX.4.64.0605170909020.3380@glacier.frostconsultingllc.com>
	<7583.1147922685@sss.pgh.pa.us>
	<Pine.LNX.4.64.0605172134370.7012@discord.home.frostconsultingllc.com>
	<8269.1147927511@sss.pgh.pa.us>
	<Pine.LNX.4.64.0605172243190.7012@discord.home.frostconsultingllc.com>
	<1147942877.2646.388.camel@localhost.localdomain>
	<Pine.LNX.4.64.0605180750580.5387@discord.home.frostconsultingllc.com>
	<Pine.LNX.4.64.0605180955570.14711@glacier.frostconsultingllc.com>
	<1148041593.2646.592.camel! @localhost.loca{ h@ | <Pine.LNX.4.64.0605190818350.5387@discord.home.frostconsultingllc.com>
	<578.1148053758@sss.pgh.pa.us>
	<Pine.LNX.4.64.06051908521! 60.7012@discord.home.frostconsultingllc.com>

Jeff Frost <jeff@frostconsultingllc.com> writes:
> Well now, will you look at this:

> postgres 20228     1  0 May17 ?        00:00:00 postgres: archiver process
> postgres 20573     1  0 May17 ?        00:00:00 postgres: archiver process
> postgres 23817 23810  0 May17 pts/11   00:00:00 postgres: archiver process

> 23810 is the running postmaster:

> postgres 23810     1  0 May17 pts/11   00:03:01 /usr/local/pgsql-8.1.3/bin/postm

Well, there's our smoking gun.  IIRC, all the failures you showed us are
consistent with race conditions caused by multiple archiver processes
all trying to do the same tasks concurrently.

Do you frequently stop and restart the postmaster?  Because I don't see
how you could get into this state without having done so.

I've just been looking at the code, and the archiver does commit
hara-kiri when it notices its parent postmaster is dead; but it only
checks that in the outer loop.  Given sufficiently long delays in the
archive_command, that could be a long time after the postmaster died;
and in the meantime, successive executions of the archive_command could
be conflicting with those launched by a later archiver incarnation.

Seems we need an interlock to ensure there's not more than one archiver
active.

			regards, tom lane



view thread (55+ messages)  latest in thread

Message-ID: <679.1148054359@sss.pgh.pa.us>
Permalink:  ../679.1148054359@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/679.1148054359@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeff@frostconsultingllc.com, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: does wal archiving block the current client connection?
  In-Reply-To: <679.1148054359@sss.pgh.pa.us>
  References: <Pine.LNX.4.64.0605150914360.9581@discord.dyndns.org> <Pine.LNX.4.64.0605151554000.9581@discord.dyndns.org> <1147781287.2646.32.camel@localhost.localdomain> <Pine.LNX.4.64.0605161119330.3380@glacier.frostconsultingllc.com> <15699.1147840569@sss.pgh.pa.us> <1147858398.2646.150.camel@localhost.localdomain> <19436.1147874478@sss.pgh.pa.us> <Pine.LNX.4.64.0605170909020.3380@glacier.frostconsultingllc.com> <7583.1147922685@sss.pgh.pa.us> <Pine.LNX.4.64.0605172134370.7012@discord.home.frostconsultingllc.com> <8269.1147927511@sss.pgh.pa.us> <Pine.LNX.4.64.0605172243190.7012@discord.home.frostconsultingllc.com> <1147942877.2646.388.camel@localhost.localdomain> <Pine.LNX.4.64.0605180750580.5387@discord.home.frostconsultingllc.com> <Pine.LNX.4.64.0605180955570.14711@glacier.frostconsultingllc.com> <578.1148053758@sss.pgh.pa.us> <679.1148054359@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox