From: | Christian Kruse <christian(at)2ndquadrant(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Patch: show relation and tuple infos of a lock to acquire |
Date: | 2014-02-27 10:44:27 |
Message-ID: | 20140227104427.GD24373@defunct.ch |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On 25/02/14 16:11, Robert Haas wrote:
> On Mon, Feb 24, 2014 at 10:13 AM, Christian Kruse
> <christian(at)2ndquadrant(dot)com> wrote:
> > To be honest, I don't like the idea of setting up this error context
> > only for log_lock_wait messages. This sounds unnecessary complex to me
> > and I think that in the few cases where this message doesn't add a
> > value (and thus is useless) don't justify such complexity.
>
> Reading this over, I'm not sure I understand why this is a CONTEXT at
> all and not just a DETAIL for the particular error message that it's
> supposed to be decorating. Generally CONTEXT should be used for
> information that will be relevant to all errors in a given code path,
> and DETAIL for extra information specific to a particular error.
Because there is more than one scenario where this context is useful,
not just log_lock_wait messages.
> If we're going to stick with CONTEXT, we could rephrase it like this:
>
> CONTEXT: while attempting to lock tuple (1,2) in relation with OID 3456
>
> or when the relation name is known:
>
> CONTEXT: while attempting to lock tuple (1,2) in relation "public"."foo"
Accepted. Patch attached.
> >> Displaying whole tuple doesn't seem to be the most right way
> >> to get debug information and especially in this case we are
> >> already displaying tuple offset(ctid) which is unique identity
> >> to identify a tuple. It seems to me that it is sufficient to display
> >> unique value of tuple if present.
> >> I understand that there is no clear issue here, so may be if others also
> >> share their opinion then it will be quite easy to take a call.
>
> I wouldn't be inclined to dump the whole tuple under any
> circumstances. That could be a lot more data than what you want
> dumped in your log. The PK could already be somewhat unreasonably
> large, but the whole tuple could be a lot more unreasonably large.
Well, as I already stated: we don't. I copied the behavior we use in
CHECK constraints (ExecBuildSlotValueDescription()).
Best regards,
--
Christian Kruse http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Attachment | Content-Type | Size |
---|---|---|
show_table_name_and_tuple_in_lock_log_v6.patch | text/x-diff | 12.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Dimitri Fontaine | 2014-02-27 11:04:24 | Re: extension_control_path |
Previous Message | Emre Hasegeli | 2014-02-27 10:39:05 | Re: GiST support for inet datatypes |