Re: Deadlock detection - Mailing list pgsql-jdbc

From Simon Riggs
Subject Re: Deadlock detection
Date
Msg-id 1232537440.2327.365.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Deadlock detection  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
On Wed, 2009-01-21 at 23:38 +1300, Oliver Jowett wrote:
> Simon Riggs wrote:
>
> > If not, other suggestions and viewpoints welcome. Thanks,
>
> If you want a minimally invasive approach (in terms of rewriting driver
> code) and some extra overhead isn't a problem then I would suggest
> something like this:

...

> The obvious costs of this are the extra thread per connection, the
> context switches needed to actually do the writes, and however much
> space you need for all the write buffers.

Thanks very much for such a detailed design.

I'd like to identify situations where deadlocks occur so we can fix
them, or confirm they haven't happened at all.

I think your proposal would work, but sounds fairly invasive. I'm
concerned that if we interfere with the main line of processing we'll
just introduce a new set of bugs that won't move us forwards. I would
prefer a "watcher" approach, which doesn't directly interfere with the
main line of processing and can be turned on/off.  Perhaps it isn't
possible?

How about a watcher thread that waits for main thread to respond, if no
response within a timeout it wakes. We then pass information to another
agent which can compare against server-side information and identify
deadlocks. A client/server deadlock detector, rather than within the
driver as I described before.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support


pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Deadlock detection
Next
From: Daniel Migowski
Date:
Subject: Re: Deadlock detection