Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire

From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2014-01-28 08:08:35
Message-ID: 20140128080835.GB26938@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 27/01/14 11:44, Rajeev rastogi wrote:
> I have checked the revised patch. It looks fine to me except one minor code formatting issue.
> In elog.c, two tabs are missing in the definition of function "errdetail_log_plural".
> Please run pgindent tool to check the same.

I did, but this reformats various other locations in the file,
too. Nevertheless I now ran pg_indent against it and removed the other
parts. Attached you will find the corrected patch version.

> Also I would like to highlight one behavior here is that process ID of process trying to
> acquire lock is also listed in the list of "Request queue". E.g.
>
> session 1 with process id X: BEGIN; LOCK TABLE foo IN SHARE MODE;
> session 2 with process id Y: BEGIN; LOCK TABLE foo IN EXCLUSIVE MODE;
>
> On execution of LOCK in session-2, as part of log it will display as:
> DETAIL: Process holding the lock: X. Request queue: Y.
>
> Where Y is the process ID of same process, which was trying to acquire lock.

This is on purpose due to the rewording of the Message. In the first
version the PID of the backend was missing.

Thanks for the review!

Best regards,

--
Christian Kruse http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
show_pids_in_lock_log_v5.patch text/x-diff 6.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2014-01-28 08:38:11 Re: Fwd: Proposal: variant of regclass
Previous Message Heikki Linnakangas 2014-01-28 07:29:24 Re: GIN improvements part2: fast scan