Re: hung postmaster when client machine dies?

From: "Goulet, Dick" <DGoulet(at)vicr(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: hung postmaster when client machine dies?
Date: 2004-01-30 15:42:42
Message-ID: 4001DEAF7DF9BD498B58B45051FBEA656D810A@25exch1.vicorpower.vicr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hope you don't mind if I disagree. Most OS's that have a tcp/ip layer also have a parameter therein called tcp_keep_alive. They also set this parameter to infinity. The purpose of tcp_keep_alive is to have the OS kernel periodically verify that all tcp/ip connections it is managing are still functioning every so often. Basically the OS sends a probe packet down the line to the to the client machine. If it bounces back the connection is dead & the OS can do what it has to, which will then notify postmaster just like you manually did. I'd contact your OS vendor for information of what tcp_keep_alive is set to by default and how you can change it.

Dick Goulet
Senior Oracle DBA
Oracle Certified 8i DBA

-----Original Message-----
From: Jeff [mailto:threshar(at)torgo(dot)978(dot)org]
Sent: Friday, January 30, 2004 10:18 AM
To: Mark Harrison
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] hung postmaster when client machine dies?

On Thu, 29 Jan 2004 17:00:27 -0800
Mark Harrison <mh(at)pixar(dot)com> 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 <jeff(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Chris Gamache 2004-01-30 17:28:59 Dump and Reload process
Previous Message Tom Lane 2004-01-30 15:42:08 Re: hung postmaster when client machine dies?