Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPC0a-0006Ld-D1 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jan 2017 17:39:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cPC0Z-0007Fj-WF for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jan 2017 17:39:24 +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_2) (envelope-from ) id 1cPBz8-0002wM-S8 for pgsql-hackers@postgresql.org; Thu, 05 Jan 2017 17:37:55 +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_2) (envelope-from ) id 1cPBz6-00010n-6y; Thu, 05 Jan 2017 17:37:53 +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 v05HbpKH006990; Thu, 5 Jan 2017 12:37:51 -0500 From: Tom Lane To: Robert Haas cc: pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Fix possible crash reading pg_stat_activity. In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Thu, 05 Jan 2017 17:31:43 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6988.1483637871.1@sss.pgh.pa.us> Date: Thu, 05 Jan 2017 12:37:51 -0500 Message-ID: <6989.1483637871@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) 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: > With the old code, a backend that read pg_stat_activity without ever > having executed a parallel query might see a backend in the midst of > executing one waiting on a DSA LWLock, resulting in a crash. The > solution is for backends to register the tranche at startup time, not > the first time a parallel query is executed. While I have no objection to the patch as committed, I have to wonder if this isn't papering over the underlying problem rather than solving it. It seems like this direction means that there's no such thing as dynamic registration of LWLock tranches and we should just give up on that concept entirely. If we do want to preserve the concept, don't we need to fix the pg_stat_activity code so it doesn't fail on tranches that aren't known locally? 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