Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPGDW-00061z-3L for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jan 2017 22:09:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cPGDV-00065v-MJ for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jan 2017 22:09:01 +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 1cPGC6-0003oa-1r for pgsql-hackers@postgresql.org; Thu, 05 Jan 2017 22:07:34 +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 1cPGC3-0006GE-JH for pgsql-hackers@postgresql.org; Thu, 05 Jan 2017 22:07:32 +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 v05M7UF8016489; Thu, 5 Jan 2017 17:07:30 -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: <6989.1483637871@sss.pgh.pa.us> <7931.1483639378@sss.pgh.pa.us> <8402.1483640139@sss.pgh.pa.us> <15257.1483652020@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 05 Jan 2017 17:02:45 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16487.1483654050.1@sss.pgh.pa.us> Date: Thu, 05 Jan 2017 17:07:30 -0500 Message-ID: <16488.1483654050@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: > On Thu, Jan 5, 2017 at 4:33 PM, Tom Lane wrote: >> Better documentation seems required, but really the whole design seems >> rather wacko. Backends must agree on numeric tranche IDs, but every >> backend has its own copy of the tranche name? How do we even know what >> agreement is? And every one has to "register" every tranche ID for >> itself? Why in the world isn't registration done *once* and the tranche >> name stored in shared memory? > Well, with the original design, that wasn't feasible, because each > backend had to store not only the name (which was constant across all > backends) but also the array_base (which might not be, if the locks > were stored in DSM) and array_stride. Since commit > 3761fe3c20bb040b15f0e8da58d824631da00caa, it would be much easier to > do what you're proposing. It's still not without difficulties, > though. There are 65,536 possible tranche IDs, and allocating an > array of 64k pointers in shared memory would consume half a megabyte > of shared memory the vast majority of which would normally be > completely unused. So I'm not very enthused about that solution, but > you aren't the first person to propose it. So, um, how do we know that backend A and backend B have the same idea about what tranche id 37 means? 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