Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aUPCD-0004ZF-Sa for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Feb 2016 01:40:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aUPCD-0001Ja-9G for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Feb 2016 01:40:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aUPCB-0001Ir-1S for pgsql-hackers@postgresql.org; Sat, 13 Feb 2016 01:40:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aUPC8-0001bc-Ct for pgsql-hackers@postgresql.org; Sat, 13 Feb 2016 01:40:22 +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 u1D1eFTA025757; Fri, 12 Feb 2016 20:40:15 -0500 From: Tom Lane To: Robert Haas cc: Andres Freund , "pgsql-hackers@postgresql.org" Subject: Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution. In-reply-to: References: <21023.1455200996@sss.pgh.pa.us> <14581.1455205343@sss.pgh.pa.us> <20201.1455210279@sss.pgh.pa.us> <24444.1455251654@sss.pgh.pa.us> <1427.1455301014@sss.pgh.pa.us> <20160212232232.GA29473@awork2.anarazel.de> Comments: In-reply-to Robert Haas message dated "Fri, 12 Feb 2016 18:44:14 -0500" Date: Fri, 12 Feb 2016 20:40:15 -0500 Message-ID: <25756.1455327615@sss.pgh.pa.us> X-Pg-Spam-Score: -2.0 (--) 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 Fri, Feb 12, 2016 at 6:22 PM, Andres Freund wrote: >> I wonder if we shouldn't just expose a 'which pid is process X waiting >> for' API, implemented serverside. That's generally really useful, and >> looks like it's actually going to be less complicated than that >> query... And it's surely going to be faster. > If PID 12000 and PID 13000 hold AccessShareLock on relation foo, and > PID 14000 awaits AccessExclusiveLock on that relation, what does the > function return when 14000 is passed as an argument? Yeah. In general, it's not that easy to say that A is waiting specifically on B --- there may be multiple blockers and/or multiple ways it could get released. isolationtester's query is not really correct IMO. It's okay as long as nothing else besides autovacuum is taking locks, but I wouldn't want to try to make it work in a general purpose environment. 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