X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 729009FA38E; Fri, 19 May 2006 12:59:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 83898-09; Fri, 19 May 2006 12:59:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 9AFA49FA226; Fri, 19 May 2006 12:59:35 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k4JFxK6T000680; Fri, 19 May 2006 11:59:20 -0400 (EDT) To: Jeff Frost cc: Simon Riggs , pgsql-admin@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: does wal archiving block the current client connection? In-reply-to: References: <1147781287.2646.32.camel@localhost.localdomain> <15699.1147840569@sss.pgh.pa.us> <1147858398.2646.150.camel@localhost.localdomain> <19436.1147874478@sss.pgh.pa.us> <7583.1147922685@sss.pgh.pa.us> <8269.1147927511@sss.pgh.pa.us> <1147942877.2646.388.camel@localhost.localdomain> <1148041593.2646.592.camel! @localhost.loca{ h@ | <578.1148053758@sss.pgh.pa.us> Comments: In-reply-to Jeff Frost message dated "Fri, 19 May 2006 08:53:51 -0700" Date: Fri, 19 May 2006 11:59:19 -0400 Message-ID: <679.1148054359@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/321 X-Sequence-Number: 21853 Jeff Frost 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