Re: Patch: show relation and tuple infos of a lock to acquire

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Christian Kruse <christian(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(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-03-18 04:00:32
Message-ID: CAA4eK1+yJQQUyXsFs3uu1T2X04w6Sc3SeSR5QEWbxmGJGP1MbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 18, 2014 at 3:38 AM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> Here's an adjusted version. In this one, the extra info is not used to
> construct a string from pieces, but instead it puts it at the end, like
> this:
>
> LOG: process 18899 still waiting for ShareLock on transaction 697 after 1000.203 ms
> CONTEXT: while operating on tuple (0,2) in relation "public"."foo" of database "postgres": updating tuple
>
> This way, each part can sensibly be translated. In fact I did translate
> one instance to test it at work, and it looks good to me:
>
> LOG: el proceso 22555 adquirió ShareLock en transacción 705 después de 1514.017 ms
> CONTEXT: mientras se operaba en la tupla (0,2) en la relación "public"."foo" de la base de datos «postgres»: actualizando tupla
>
> Now there might be bikeshedding on the exact wording I've chosen for
> each instance of context setup, but I expect it's a fairly minor point
> now.
>
> One remaining issue is that now ConditionalXactLockTableWait doesn't set
> up error context info.

ConditionalXactLockTableWait() is not going to block on lock which
is when this new context will be printed. So I think there is no need
to change it. Is there a case where it will be needed which I am
missing?

> We could solve this by having a common routine
> that serves both that one and XactLockTableWait (much like
> Do_MultiXactIdWait does), but I'm not sure it's worth the trouble.
> Thoughts?

> Therefore I think the only case worth considering here is when
> database/relation/TID are all defined. The other cases where there is
> partial information are dead code; and the case where there is nothing
> defined (such as the one in SnapBuildFindSnapshot) is already handled by
> simply not setting up a context at all.

Right. So I think we should just keep one version of message.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Atri Sharma 2014-03-18 05:17:59 Re: Planner hints in Postgresql
Previous Message Kouhei Kaigai 2014-03-18 03:54:19 Re: Triggers on foreign tables