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

Lists: pgsql-hackers
From: Christian Kruse <christian(at)2ndQuadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2013-12-30 19:52:25
Message-ID: 20131230195225.GA19529@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi there,

I created two patches improving the log messages generated by
log_lock_waits. The first patch shows the process IDs holding a lock
we try to acquire (show_pids_in_lock_log.patch), sample output
(log_lock_waits=on required):

session 1: BEGIN; LOCK TABLE foo IN SHARE MODE;
session 2: BEGIN; LOCK TABLE foo IN SHARE MODE;
session 3: BEGIN; LOCK TABLE foo IN EXCLUSIVE MODE;

Output w/o patch:

LOG: process 13777 still waiting for ExclusiveLock on relation 16385 of database 16384 after 1000.030 ms

Output with patch:

LOG: process 13777 still waiting for ExclusiveLock on relation 16385 of database 16384 after 1000.030 ms
CONTEXT: processes owning lock: 13775, 13776

The second patch (show_table_name_and_tuple_in_lock_log.patch)
includes relation info (table name and OID) as well as some tuple
information (if available). Sample output (log_lock_waits=on required):

session 1:
CREATE TABLE foo (val integer);
INSERT INTO foo (val) VALUES (1);
BEGIN;
UPDATE foo SET val = 3;

session 2:
BEGIN;
UPDATE TABLE foo SET val = 2;

Output w/o patch:

LOG: process 24774 acquired ShareLock on transaction 696 after 11688.720 ms

Output with patch:

LOG: process 24774 acquired ShareLock on transaction 696 after 11688.720 ms
CONTEXT: relation name: foo (OID 16385)
tuple (ctid (0,1)): (1)

Regarding this patch I am not really sure where to put the
functions. Currently they are located in backend/storage/lmgr/lmgr.c
because XactLockTableWait() is located there, too. What do you think?

I also created two test specs for easy creation of the log output;
however, I was not able to provide an expected file since the process
IDs vary from test run to test run.

Regards,

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

Attachment Content-Type Size
show_pids_in_lock_log.patch text/x-diff 3.7 KB
show_table_name_and_tuple_in_lock_log.patch text/x-diff 11.6 KB
lock-log-contains-pids.spec text/plain 784 bytes
lock-log-contains-tuple-and-relation.spec text/plain 555 bytes

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2013-12-31 08:48:43
Message-ID: CA+U5nMJfASqKAJsgjoAk+gWy-BZpeyBJJmaxq4t5LwLu3q7=AQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 30 December 2013 19:52, Christian Kruse <christian(at)2ndquadrant(dot)com> wrote:

> I created two patches..

Patches are related but separate, so should be tracked on separate
threads. Please add them to the CF app also.

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


From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2013-12-31 09:19:20
Message-ID: 20131231091920.GC25649@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 31/12/13 08:48, Simon Riggs wrote:
> > I created two patches..
>
> Patches are related but separate, so should be tracked on separate
> threads.

[x] Done (in <20131231091244(dot)GB25649(at)defunct(dot)ch>)

> Please add them to the CF app also.

[x] Done. I modified the existing commitfest entry
(<https://commitfest.postgresql.org/action/patch_view?id=1350>) and
the second, new one is located here:

<https://commitfest.postgresql.org/action/patch_view?id=1351>

Regards,

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


From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Christian Kruse <christian(at)2ndQuadrant(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2014-01-22 03:42:21
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDBB94C@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 31st December 2013, Christian Kruse Wrote:

> Hi there,
>
> I created two patches improving the log messages generated by
> log_lock_waits. The first patch shows the process IDs holding a lock we
> try to acquire (show_pids_in_lock_log.patch), sample output
> (log_lock_waits=on required):
>
> session 1: BEGIN; LOCK TABLE foo IN SHARE MODE; session 2: BEGIN; LOCK
> TABLE foo IN SHARE MODE; session 3: BEGIN; LOCK TABLE foo IN EXCLUSIVE
> MODE;
>
> Output w/o patch:
>
> LOG: process 13777 still waiting for ExclusiveLock on relation 16385
> of database 16384 after 1000.030 ms
>
> Output with patch:
>
> LOG: process 13777 still waiting for ExclusiveLock on relation 16385
> of database 16384 after 1000.030 ms
> CONTEXT: processes owning lock: 13775, 13776

I am reviewing this patch. The idea seems to be reasonable.
Following are my first level observation:

1. I find a issue in following scenario:

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;
session 3 with process id Z: BEGIN; LOCK TABLE foo IN SHARE MODE;

On execution of LOCK in session-3, as part of log it will display as:
processes owning lock: X, Y
But actually if we see Y has not yet own the lock, it is still waiting with higher priority.
It may mislead user.
May be we should change message to give all meaning i.e. which process is owning lock and
Which process is already in queue.

2. Can we give a better name to new variable 'buf1'?

3. Do we need to take performance reading to see if any impact?

4. Do we require documentation?

Thanks and Regards,
Kumar Rajeev Rastogi


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: Christian Kruse <christian(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2014-01-22 11:40:35
Message-ID: CA+U5nMJi=1nYAWKH5LmyaDC+zMNx_cSuKZXYg_J6uV9xQgaAUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 22 January 2014 04:42, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com> wrote:
>
> On 31st December 2013, Christian Kruse Wrote:
>
>> Hi there,
>>
>> I created two patches improving the log messages generated by
>> log_lock_waits. The first patch shows the process IDs holding a lock we
>> try to acquire (show_pids_in_lock_log.patch), sample output
>> (log_lock_waits=on required):
>>
>> session 1: BEGIN; LOCK TABLE foo IN SHARE MODE; session 2: BEGIN; LOCK
>> TABLE foo IN SHARE MODE; session 3: BEGIN; LOCK TABLE foo IN EXCLUSIVE
>> MODE;
>>
>> Output w/o patch:
>>
>> LOG: process 13777 still waiting for ExclusiveLock on relation 16385
>> of database 16384 after 1000.030 ms
>>
>> Output with patch:
>>
>> LOG: process 13777 still waiting for ExclusiveLock on relation 16385
>> of database 16384 after 1000.030 ms
>> CONTEXT: processes owning lock: 13775, 13776
>
> I am reviewing this patch. The idea seems to be reasonable.
> Following are my first level observation:
>
> 1. I find a issue in following scenario:
>
> 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;
> session 3 with process id Z: BEGIN; LOCK TABLE foo IN SHARE MODE;
>
> On execution of LOCK in session-3, as part of log it will display as:
> processes owning lock: X, Y
> But actually if we see Y has not yet own the lock, it is still waiting with higher priority.
> It may mislead user.
> May be we should change message to give all meaning i.e. which process is owning lock and
> Which process is already in queue.

Perhaps this?

CONTEXT: lock owner XXXX request queue XXX, XXX, XXX, etc

> 2. Can we give a better name to new variable 'buf1'?
>
> 3. Do we need to take performance reading to see if any impact?

Don't think so. Diagnosing problems will help performance, not hinder it

> 4. Do we require documentation?

Don't think so.

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


From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2014-01-22 16:04:42
Message-ID: 20140122160442.GK23743@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 22/01/14 12:40, Simon Riggs wrote:
> > 1. I find a issue in following scenario:
> >
> > 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;
> > session 3 with process id Z: BEGIN; LOCK TABLE foo IN SHARE MODE;
> >
> > On execution of LOCK in session-3, as part of log it will display as:
> > processes owning lock: X, Y
> > But actually if we see Y has not yet own the lock, it is still waiting with higher priority.
> > It may mislead user.
> > May be we should change message to give all meaning i.e. which process is owning lock and
> > Which process is already in queue.
>
> Perhaps this?
>
> CONTEXT: lock owner XXXX request queue XXX, XXX, XXX, etc

Fixed.

> > 2. Can we give a better name to new variable 'buf1'?

Fixed.

> > 3. Do we need to take performance reading to see if any impact?
>
> Don't think so. Diagnosing problems will help performance, not hinder it

I agree. And this code path will only get executed when log_lock_waits
= on, which seems to be a debugging method to me.

Best regards,

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

Attachment Content-Type Size
show_pids_in_lock_log_v2.patch text/x-diff 4.6 KB

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2014-01-22 16:17:29
Message-ID: 20140122161729.GO10723@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Christian Kruse wrote:

I think this could use some more comments -- for instance at the top of
the while loop, explain what's its purpose.

> if (deadlock_state == DS_SOFT_DEADLOCK)
> ereport(LOG,
> (errmsg("process %d avoided deadlock for %s on %s by rearranging queue order after %ld.%03d ms",
> - MyProcPid, modename, buf.data, msecs, usecs)));
> + MyProcPid, modename, buf.data, msecs, usecs),
> + (errcontext(ngettext("process owning lock: %s request queue: %s",
> + "processes owning lock: %s request queue: %s",
> + lockHoldersNum), lock_holders_sbuf.data, lock_waiters_sbuf.data))));

This ngettext() call is repeated four times in the new code, which is a
bit annoying because it's not trivial. I think you could assign the
ngettext() to a char * at the bottom of the loop, and then in the
ereport() calls use it:

char *errcxt = NULL;

while ( ... )
{
...
errcxt = ngettext("processes owning lock: ..");
}

ereport(LOG,
(errmsg("blah blah"),
errcxt != NULL ? errcontext(errcxt) : 0));

That would avoid the repetition.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


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

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> This ngettext() call is repeated four times in the new code, which is a
> bit annoying because it's not trivial. I think you could assign the
> ngettext() to a char * at the bottom of the loop, and then in the
> ereport() calls use it:

Would that not break the compiler's ability to verify the format codes
in the string? Not to mention make it harder for people to compare
format to arguments, too?

However, the real problem here is that you shouldn't be calling ngettext
manually in an ereport context in the first place. There is
infrastructure in place for that, and this isn't using it.

regards, tom lane


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

Hi,

attached you will find a new version of the patch containing more
comments.

On 22/01/14 12:00, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > This ngettext() call is repeated four times in the new code, which is a
> > bit annoying because it's not trivial. I think you could assign the
> > ngettext() to a char * at the bottom of the loop, and then in the
> > ereport() calls use it:
>
> Would that not break the compiler's ability to verify the format codes
> in the string? Not to mention make it harder for people to compare
> format to arguments, too?

I agree.

> However, the real problem here is that you shouldn't be calling ngettext
> manually in an ereport context in the first place. There is
> infrastructure in place for that, and this isn't using it.

Fixed in attached patch. I changed it from calling
errorcontext(ngettext()) to calling errdetail_plural().

Best regards,

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

Attachment Content-Type Size
show_pids_in_lock_log_v3.patch text/x-diff 4.9 KB

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

Christian Kruse <christian(at)2ndquadrant(dot)com> writes:
>> However, the real problem here is that you shouldn't be calling ngettext
>> manually in an ereport context in the first place. There is
>> infrastructure in place for that, and this isn't using it.

> Fixed in attached patch. I changed it from calling
> errorcontext(ngettext()) to calling errdetail_plural().

Well, is it context or detail? Those fields have reasonably well defined
meanings IMO.

If we need errcontext_plural, let's add it, not adopt inferior solutions
just because that isn't there for lack of previous need.

But having said that, I think this is indeed detail not context.
(I kinda wonder whether some of the stuff that's now in the primary
message shouldn't be pushed to errdetail as well. It looks like some
previous patches in this area have been lazy.)

While I'm griping, this message isn't even trying to follow the project's
message style guidelines. Detail or context messages are supposed to be
complete sentence(s), with capitalization and punctuation to match.

Lastly, is this information that we want to be shipping to clients?
Perhaps from a security standpoint that's not such a wise idea, and
errdetail_log() is what should be used.

regards, tom lane


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

Hi,

On 22/01/14 14:45, Tom Lane wrote:
> Well, is it context or detail? Those fields have reasonably well defined
> meanings IMO.

I find the distinction somewhat blurry and think both would be
appropriate. But since I wasn't sure I changed to detail.

> If we need errcontext_plural, let's add it, not adopt inferior solutions
> just because that isn't there for lack of previous need.

I would've added it if I would've been sure.

> But having said that, I think this is indeed detail not context.
> (I kinda wonder whether some of the stuff that's now in the primary
> message shouldn't be pushed to errdetail as well. It looks like some
> previous patches in this area have been lazy.)

I agree, the primary message is not very well worded. On the other
hand finding an appropriate alternative seems hard for me.

> While I'm griping, this message isn't even trying to follow the project's
> message style guidelines. Detail or context messages are supposed to be
> complete sentence(s), with capitalization and punctuation to match.

Hm, I hope I fixed it in this version of the patch.

> Lastly, is this information that we want to be shipping to clients?
> Perhaps from a security standpoint that's not such a wise idea, and
> errdetail_log() is what should be used.

Fixed. I added an errdetail_log_plural() for this, too.

Best regards,

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

Attachment Content-Type Size
show_pids_in_lock_log_v3.patch text/x-diff 4.9 KB

From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(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-23 09:08:06
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDBC00D@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 23/01/14 14:45, Christian Kruse wrote:
> > Well, is it context or detail? Those fields have reasonably well
> > defined meanings IMO.
>
> I find the distinction somewhat blurry and think both would be
> appropriate. But since I wasn't sure I changed to detail.
>
> > If we need errcontext_plural, let's add it, not adopt inferior
> > solutions just because that isn't there for lack of previous need.
>
> I would've added it if I would've been sure.
>
> > But having said that, I think this is indeed detail not context.
> > (I kinda wonder whether some of the stuff that's now in the primary
> > message shouldn't be pushed to errdetail as well. It looks like some
> > previous patches in this area have been lazy.)
>
> I agree, the primary message is not very well worded. On the other hand
> finding an appropriate alternative seems hard for me.
>
> > While I'm griping, this message isn't even trying to follow the
> > project's message style guidelines. Detail or context messages are
> > supposed to be complete sentence(s), with capitalization and
> punctuation to match.
>
> Hm, I hope I fixed it in this version of the patch.
>
> > Lastly, is this information that we want to be shipping to clients?
> > Perhaps from a security standpoint that's not such a wise idea, and
> > errdetail_log() is what should be used.
>
> Fixed. I added an errdetail_log_plural() for this, too.

I think you have attached wrong patch.

Thanks and Regards,
Kumar Rajeev Rastogi


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-23 09:15:11
Message-ID: 20140123091511.GN23743@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

> I think you have attached wrong patch.

Hurm. You are right, attached v3, not v4. Sorry.

Best regards,

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

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

From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(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-27 11:44:49
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDBCCBF@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 23/01/14, Christian Kruse wrote:
> > Well, is it context or detail? Those fields have reasonably well
> > defined meanings IMO.
>
> I find the distinction somewhat blurry and think both would be
> appropriate. But since I wasn't sure I changed to detail.
>
> > If we need errcontext_plural, let's add it, not adopt inferior
> > solutions just because that isn't there for lack of previous need.
>
> I would've added it if I would've been sure.
>
> > But having said that, I think this is indeed detail not context.
> > (I kinda wonder whether some of the stuff that's now in the primary
> > message shouldn't be pushed to errdetail as well. It looks like some
> > previous patches in this area have been lazy.)
>
> I agree, the primary message is not very well worded. On the other hand
> finding an appropriate alternative seems hard for me.
>
> > While I'm griping, this message isn't even trying to follow the
> > project's message style guidelines. Detail or context messages are
> > supposed to be complete sentence(s), with capitalization and
> punctuation to match.
>
> Hm, I hope I fixed it in this version of the patch.
>
> > Lastly, is this information that we want to be shipping to clients?
> > Perhaps from a security standpoint that's not such a wise idea, and
> > errdetail_log() is what should be used.
>
> Fixed. I added an errdetail_log_plural() for this, too.

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.

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.

To me, it seems to be correct behavior as the meaning of message will be
list of all processes already holding the lock and processes waiting in queue and
position of self process in wait-list. In above example, it will indicate that
process Y in on top of wait list.

Thanks and Regards,
Kumar Rajeev Rastogi


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
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

From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(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 09:39:17
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDBD252@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 28/01/14, Christian Kruse 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!
>

Now patch looks fine to me. I am marking this as "Ready for Committer".

Thanks and Regards,
Kumar Rajeev Rastogi


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: Christian Kruse <christian(at)2ndquadrant(dot)com>, 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-31 17:45:03
Message-ID: CAHGQGwH55E9ZQ34fR2jBr9q-i4vLo5jqrg-GztxDzWWT+TCMNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jan 28, 2014 at 6:39 PM, Rajeev rastogi
<rajeev(dot)rastogi(at)huawei(dot)com> wrote:
> On 28/01/14, Christian Kruse 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!
>>
>
> Now patch looks fine to me. I am marking this as "Ready for Committer".

When I tested the patch, I got the strange behavior.

1. I executed the SELECT FOR UPDATE query and kept waiting for a while
in the session 1.

[session 1] PID=33660
BEGIN;
SELECT * FROM t WHERE i = 1 FOR UPDATE;
(Wait)

2. I executed the SELECT FOR UPDATE query again in the session 2.

[session 2] PID=33662
BEGIN;
SELECT * FROM t WHERE i = 1 FOR UPDATE;
(Waiting for the lock)

3. I got the following log message. This is OK.

LOG: process 33662 still waiting for ShareLock on transaction
1011 after 1000.184 ms
DETAIL: Process holding the lock: 33660. Request queue: 33662.

4. I executed the UPDATE query in the session 3.

[session 3] PID=33665
UPDATE t SET j = j + 1 WHERE i = 1;
(Waiting for the lock)

5. Then, I got the following log message. This looks strange and
confusing to me.

LOG: process 33665 still waiting for ExclusiveLock on tuple (0,4)
of relation 16384 of database 12310 after 1000.134 ms
DETAIL: Process holding the lock: 33662. Request queue: 33665

This log message says that the process 33662 is holding the lock, but
it's not true.
The process holding the lock is 33660. The process 33662 should be in
the request
queue. Is this the intentional behavior?

Regards,

--
Fujii Masao


From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, 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-02-01 10:41:54
Message-ID: 20140201104154.GD12556@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 01/02/14 02:45, Fujii Masao wrote:

> LOG: process 33662 still waiting for ShareLock on transaction
> 1011 after 1000.184 ms
> DETAIL: Process holding the lock: 33660. Request queue: 33662.
> [… snip …]
> LOG: process 33665 still waiting for ExclusiveLock on tuple (0,4)
> of relation 16384 of database 12310 after 1000.134 ms
> DETAIL: Process holding the lock: 33662. Request queue: 33665
>
> This log message says that the process 33662 is holding the lock, but
> it's not true.

As the message says: first lock is waiting for the transaction, second
one for the tuple. So that are two different locks thus the two
different holders and queues. So…

> Is this the intentional behavior?

Yes, I think so.

Best regards,

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


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>
Cc: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, 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-02-03 08:59:11
Message-ID: CAHGQGwGVFGCpqpPbgjEG+tvas3y6Ayg+6XcKaTPpytB1gPOiiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Feb 1, 2014 at 7:41 PM, Christian Kruse
<christian(at)2ndquadrant(dot)com> wrote:
> Hi,
>
> On 01/02/14 02:45, Fujii Masao wrote:
>
>> LOG: process 33662 still waiting for ShareLock on transaction
>> 1011 after 1000.184 ms
>> DETAIL: Process holding the lock: 33660. Request queue: 33662.
>> [... snip ...]
>> LOG: process 33665 still waiting for ExclusiveLock on tuple (0,4)
>> of relation 16384 of database 12310 after 1000.134 ms
>> DETAIL: Process holding the lock: 33662. Request queue: 33665
>>
>> This log message says that the process 33662 is holding the lock, but
>> it's not true.
>
> As the message says: first lock is waiting for the transaction, second
> one for the tuple. So that are two different locks thus the two
> different holders and queues. So...
>
>> Is this the intentional behavior?
>
> Yes, I think so.

Oh, yes. You're right.

I have other minor comments:

Since you added errdetail_log_plural(), ISTM that you need to update
sources.sgml.

>> While I'm griping, this message isn't even trying to follow the project's
>> message style guidelines. Detail or context messages are supposed to be
>> complete sentence(s), with capitalization and punctuation to match.
>
> Hm, I hope I fixed it in this version of the patch.

Current message doesn't look like complete sentence yet... We would
need to use something like "Processes X, Y are holding while Z is waiting
for the lock.". I could not come up with good message, though..

Regards,

--
Fujii Masao


From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, 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-02-03 10:06:35
Message-ID: 20140203100635.GA27009@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 03/02/14 17:59, Fujii Masao wrote:
> Since you added errdetail_log_plural(), ISTM that you need to update
> sources.sgml.

[x] Fixed.

> >> While I'm griping, this message isn't even trying to follow the project's
> >> message style guidelines. Detail or context messages are supposed to be
> >> complete sentence(s), with capitalization and punctuation to match.
> >
> > Hm, I hope I fixed it in this version of the patch.
>
> Current message doesn't look like complete sentence yet... We would
> need to use something like "Processes X, Y are holding while Z is waiting
> for the lock.". I could not come up with good message, though..

The problem is that we have two potential plural cases in this
message. That leads to the need to formulate the second part
independently from singular/plural. I tried to improve a little bit
and propose this message:

Singular:
"The following process is holding the lock: A. The request queue
consists of: B."

Plural:
"Following processes are holding the lock: A, B. The request queue
consists of: C."

Attached you will find an updated patch.

Best regards,

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

Attachment Content-Type Size
show_pids_in_lock_log_v6.patch text/x-diff 7.8 KB

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, Alvaro Herrera <alvherre(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-02-03 10:43:04
Message-ID: CA+U5nM+Fi5R8Zp60xwnfD5iiaXDoa2_mU_9KmK+Pnb5eZL_JWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 3 February 2014 10:06, Christian Kruse <christian(at)2ndquadrant(dot)com> wrote:
> Hi,
>
> On 03/02/14 17:59, Fujii Masao wrote:
>> Since you added errdetail_log_plural(), ISTM that you need to update
>> sources.sgml.
>
> [x] Fixed.
>
>> >> While I'm griping, this message isn't even trying to follow the project's
>> >> message style guidelines. Detail or context messages are supposed to be
>> >> complete sentence(s), with capitalization and punctuation to match.
>> >
>> > Hm, I hope I fixed it in this version of the patch.
>>
>> Current message doesn't look like complete sentence yet... We would
>> need to use something like "Processes X, Y are holding while Z is waiting
>> for the lock.". I could not come up with good message, though..
>
> The problem is that we have two potential plural cases in this
> message. That leads to the need to formulate the second part
> independently from singular/plural. I tried to improve a little bit
> and propose this message:
>
> Singular:
> "The following process is holding the lock: A. The request queue
> consists of: B."
>
> Plural:
> "Following processes are holding the lock: A, B. The request queue
> consists of: C."

Seems too complex. How about this...

"Lock holder(s): A. Lock waiter(s) B"
"Lock holder(s): A, B. Lock waiter(s) C"

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


From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, Alvaro Herrera <alvherre(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-02-03 11:53:52
Message-ID: 20140203115352.GB14043@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi Simon,

On 03/02/14 10:43, Simon Riggs wrote:
> > Singular:
> > "The following process is holding the lock: A. The request queue
> > consists of: B."
> >
> > Plural:
> > "Following processes are holding the lock: A, B. The request queue
> > consists of: C."
>
> Seems too complex. How about this...
>
> "Lock holder(s): A. Lock waiter(s) B"
> "Lock holder(s): A, B. Lock waiter(s) C"

This is basically the same as before, it is even shorter. The
complaint was that I don't use a whole sentence in this error
detail. Won't the change fulfill the same complaint?

To be honest, I'd like to stick with your earlier proposal:

Singular:
Process holding the lock: A. Request queue: B

Plural:
Processes holding the lock: A, B. Request queue: C, D

This seems to be a good trade-off between project guidelines,
readability and parsability.

Best regards,

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


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, Alvaro Herrera <alvherre(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-02-04 03:38:02
Message-ID: CAHGQGwH4zAZMp6BfoL4Bcsid7GZoT=Xz9kzD_2dLBr5id9OKFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Feb 3, 2014 at 8:53 PM, Christian Kruse
<christian(at)2ndquadrant(dot)com> wrote:
> Hi Simon,
>
> On 03/02/14 10:43, Simon Riggs wrote:
>> > Singular:
>> > "The following process is holding the lock: A. The request queue
>> > consists of: B."
>> >
>> > Plural:
>> > "Following processes are holding the lock: A, B. The request queue
>> > consists of: C."
>>
>> Seems too complex. How about this...
>>
>> "Lock holder(s): A. Lock waiter(s) B"
>> "Lock holder(s): A, B. Lock waiter(s) C"
>
> This is basically the same as before, it is even shorter. The
> complaint was that I don't use a whole sentence in this error
> detail. Won't the change fulfill the same complaint?
>
> To be honest, I'd like to stick with your earlier proposal:
>
> Singular:
> Process holding the lock: A. Request queue: B
>
> Plural:
> Processes holding the lock: A, B. Request queue: C, D
>
> This seems to be a good trade-off between project guidelines,
> readability and parsability.

ISTM that the phrase "Request queue" is not used much around the lock.
Using the phrase "wait queue" or Simon's suggestion sound better to at least me.
Thought?

Regards,

--
Fujii Masao


From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, Alvaro Herrera <alvherre(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-02-04 08:39:42
Message-ID: 20140204083942.GD10459@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 04/02/14 12:38, Fujii Masao wrote:
> ISTM that the phrase "Request queue" is not used much around the lock.
> Using the phrase "wait queue" or Simon's suggestion sound better to at least me.
> Thought?

Sounds reasonable to me. Attached patch changes messages to the following:

Process holding the lock: A. Wait queue: B.
Processes holding the lock: A, B. Wait queue: C.

Best regards,

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

Attachment Content-Type Size
show_pids_in_lock_log_v7.patch text/x-diff 7.5 KB

From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(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-02-04 09:08:30
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDBF148@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 4th February 2014, Christian kruse Wrote:
> On 04/02/14 12:38, Fujii Masao wrote:
> > ISTM that the phrase "Request queue" is not used much around the lock.
> > Using the phrase "wait queue" or Simon's suggestion sound better to
> at least me.
> > Thought?
>
> Sounds reasonable to me. Attached patch changes messages to the
> following:
>
> Process holding the lock: A. Wait queue: B.
> Processes holding the lock: A, B. Wait queue: C.

This looks good to me also.

Thanks and Regards,
Kumar Rajeev Rastogi


From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(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>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire
Date: 2014-02-25 04:03:14
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDC4796@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 04 February 2014 14:38, Myself wrote:

>
> On 4th February 2014, Christian kruse Wrote:
> > On 04/02/14 12:38, Fujii Masao wrote:
> > > ISTM that the phrase "Request queue" is not used much around the
> lock.
> > > Using the phrase "wait queue" or Simon's suggestion sound better to
> > at least me.
> > > Thought?
> >
> > Sounds reasonable to me. Attached patch changes messages to the
> > following:
> >
> > Process holding the lock: A. Wait queue: B.
> > Processes holding the lock: A, B. Wait queue: C.
>
> This looks good to me also.

I have tested the revised patch and found ready to be committed.

I am marking this as "Ready for Committer".

Thanks and Regards,
Kumar Rajeev Rastogi


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: Christian Kruse <christian(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(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-03-12 18:27:56
Message-ID: CAHGQGwHMP_yaiVYy8scTCLO+no9b+a23Y5+jQWFPwp410HpXLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Feb 25, 2014 at 1:03 PM, Rajeev rastogi
<rajeev(dot)rastogi(at)huawei(dot)com> wrote:
> On 04 February 2014 14:38, Myself wrote:
>
>>
>> On 4th February 2014, Christian kruse Wrote:
>> > On 04/02/14 12:38, Fujii Masao wrote:
>> > > ISTM that the phrase "Request queue" is not used much around the
>> lock.
>> > > Using the phrase "wait queue" or Simon's suggestion sound better to
>> > at least me.
>> > > Thought?
>> >
>> > Sounds reasonable to me. Attached patch changes messages to the
>> > following:
>> >
>> > Process holding the lock: A. Wait queue: B.
>> > Processes holding the lock: A, B. Wait queue: C.
>>
>> This looks good to me also.
>
> I have tested the revised patch and found ready to be committed.
>
> I am marking this as "Ready for Committer".

Committed!

Regards,

--
Fujii Masao


From: Christian Kruse <christian(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(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-03-12 23:36:37
Message-ID: 20140312233637.GA17060@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 13/03/14 03:27, Fujii Masao wrote:
> Committed!

Thank you very much!

Best regards,

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