On 30.01.2012 20:27, Robert Haas wrote:
Either this patch, or something else committed this morning, is
causing "make check" to hang or run extremely slowly for me.  I think
it's this patch, because I attached to a backend and stopped it a few
times, and all the backtraces look like this:

Yeah, sure looks like it's the group commit commit. It works for me, and staring at the code, I have no idea what could be causing it. The buildfarm seems happy too, so this is pretty mysterious.

I did find one bug, see attached, but AFAICS it should only cause unnecessary wakeups in some corner cases, which is harmless.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com
commit 73b479198d9e7e1cbdb2da705a0cd9226b0d8265
Author: Heikki Linnakangas <heikki.linnakan...@iki.fi>
Date:   Mon Jan 30 20:56:35 2012 +0200

    Fix thinko in the group commit patch.
    
    When releasing a lwlock, if the first waiter in the queue waited for a
    shared lock, and all the rest were of the new "wait-until-free" kind, the
    releaseOK flag would not be cleared. That's harmless AFAICS, but it was
    not intended.

diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index bee35b8..eb9ff95 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -768,9 +768,9 @@ LWLockRelease(LWLockId lockid)
 				while (proc->lwWaitLink != NULL &&
 					   proc->lwWaitLink->lwWaitMode != LW_EXCLUSIVE)
 				{
-					proc = proc->lwWaitLink;
 					if (proc->lwWaitMode != LW_WAIT_UNTIL_FREE)
 						releaseOK = false;
+					proc = proc->lwWaitLink;
 				}
 			}
 			/* proc is now the last PGPROC to be released */
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to