Re: Improving deadlock error messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improving deadlock error messages
Date
Msg-id 19378.1177052137@sss.pgh.pa.us
Whole thread Raw
In response to Improving deadlock error messages  (Neil Conway <neilc@samurai.com>)
Responses Re: Improving deadlock error messages
Re: Improving deadlock error messages
List pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> I whipped up a quick patch to use names as well as OIDs for the
> identifiers in the message, but on reflection the simple approach to
> doing this is problematic: when we do syscache lookups to lookup the
> identifier names, we might need to acquire an AccessShareLock on various
> system catalogs (pg_class, pg_namespace, pg_database). This could fail
> (e.g. because of a deadlock involving a system catalog), causing the
> deadlock detector to infinitely recurse (albeit slowly).

Yup, that's exactly why it doesn't do that already.

> We could fix this by first conditionally acquiring AccessShareLocks on
> the necessary system catalogs.

I don't think you've thought of quite all of the failure cases.  One
that's a bit pressing is that a deadlock isn't necessarily confined to
objects in your own database.

My take on this is that I'd much rather have unfriendly information
than none at all.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Improving deadlock error messages
Next
From: Zoltan Boszormenyi
Date:
Subject: Re: parser dilemma