X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C7CC8D1CCDB for ; Fri, 30 Jan 2004 15:15:23 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 63538-09 for ; Fri, 30 Jan 2004 11:15:27 -0400 (AST) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 7B7F4D1CCD6 for ; Fri, 30 Jan 2004 11:15:22 -0400 (AST) Received: (qmail 96090 invoked from network); 30 Jan 2004 15:15:29 -0000 Received: from localhost (HELO squeegit) (threshar@127.0.0.1) by localhost with SMTP; 30 Jan 2004 15:15:29 -0000 Date: Fri, 30 Jan 2004 10:18:07 -0500 From: Jeff To: Mark Harrison Cc: pgsql-admin@postgresql.org Subject: Re: hung postmaster when client machine dies? Message-Id: <20040130101807.476528cc.threshar@torgo.978.org> In-Reply-To: <4019ACAB.4010600@pixar.com> References: <4019ACAB.4010600@pixar.com> X-Mailer: Sylpheed version 0.9.9 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/293 X-Sequence-Number: 12156 On Thu, 29 Jan 2004 17:00:27 -0800 Mark Harrison wrote: > We observed that there was postmaster connected to the ip address > of the downed machine with an "in transaction" status. Killing > that processes unblocked the other processes. > > Is this expected behavior? Was postgres simply waiting for > a failure from the TCP/IP layer? > When a machine simply "goes away" (crashed, unplugged) no packets are sent indicating the socket has closed so PG doesn't know the socket is closed and cannot rollback the transaction. (This is true of any tcp-based protocol). If that connection had a transaction open it'll likely have rows locked. Killing PG caused it to rollback that transaction freeing those locks. Eventually PG would have found out the socket was dead. Most likely if it tried to write to it. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/