Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aV57m-0003c5-1B for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Feb 2016 22:26:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aV57l-0007B1-K1 for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Feb 2016 22:26:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aV57i-00079m-Vm for pgsql-hackers@postgresql.org; Sun, 14 Feb 2016 22:26:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aV57Z-00019X-Ms for pgsql-hackers@postgresql.org; Sun, 14 Feb 2016 22:26:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u1EMQNdD030321; Sun, 14 Feb 2016 17:26:23 -0500 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: Re: [COMMITTERS] pgsql: Introduce group locking to prevent parallel processes from deadl In-reply-to: References: <27041.1455388321@sss.pgh.pa.us> <22842.1455474783@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Sun, 14 Feb 2016 14:02:08 -0500" Date: Sun, 14 Feb 2016 17:26:23 -0500 Message-ID: <30320.1455488783@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > On Sun, Feb 14, 2016 at 1:33 PM, Tom Lane wrote: >> pgprocno of the specific PGPROC, or of the group leader? If it's >> the former, I'm pretty suspicious that there are deadlock and/or >> linked-list-corruption hazards here. If it's the latter, at least >> the comments around this are misleading. > Leader. The other way would be nuts. ... and btw, either BecomeLockGroupMember() has got this backwards, or I'm still fundamentally confused. Also, after fixing that it would be good to add a comment explaining why it's not fundamentally unsafe for BecomeLockGroupMember() to examine leader->pgprocno without having any relevant lock. AFAICS, that's only okay because the pgprocno fields are never changed after InitProcGlobal, even when a PGPROC is recycled. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers