Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffqpc-0000XH-72 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Jul 2018 18:05:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ffqpX-0008Sm-88 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Jul 2018 18:05:39 +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.89) (envelope-from ) id 1ffqpX-0008Se-14 for pgsql-hackers@lists.postgresql.org; Wed, 18 Jul 2018 18:05:39 +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.89) (envelope-from ) id 1ffqpP-0005hN-9c for pgsql-hackers@postgresql.org; Wed, 18 Jul 2018 18:05:38 +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 w6II5HiN007343; Wed, 18 Jul 2018 14:05:17 -0400 From: Tom Lane To: Robert Haas cc: Kyotaro HORIGUCHI , Andres Freund , Michael Paquier , Justin Pryzby , "pgsql-hackers@postgresql.org" Subject: Re: ENOSPC FailedAssertion("!(RefCountErrors == 0)" In-reply-to: References: <20436.1531751966@sss.pgh.pa.us> <4993.1531773411@sss.pgh.pa.us> <14892.1531872065@sss.pgh.pa.us> <20180718.124220.08087886.horiguchi.kyotaro@lab.ntt.co.jp> <10690.1531924381@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 18 Jul 2018 13:03:20 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7341.1531937117.1@sss.pgh.pa.us> Date: Wed, 18 Jul 2018 14:05:17 -0400 Message-ID: <7342.1531937117@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Wed, Jul 18, 2018 at 10:33 AM, Tom Lane wrote: >>> So couldn't we use TopTransactionResourceOwner instead of >>> AuxProcessResrouceOwner? I feel a bit uneasy that bootstrap and >>> standalone-backend have *AuxProcess*ResourceOwner. >> Since the aux processes aren't running transactions, I didn't think >> that TopTransactionResourceOwner was appropriate. There's also >> a problem for bootstrap and standalone backend cases: those do run >> transactions and therefore create/destroy TopTransactionResourceOwner, >> leaving nothing behind for ShutdownXLOG to use if it tries to use >> that. We need an extra resowner somewhere. > FallbackResourceOwner? DefaultResourceOwner? SessionResourceOwner? Those names all suggest (to me anyway) that this resowner exists in all, or at least most, processes. That's not the situation as of this patch, although I could imagine an alternate universe where it's true; for example, if we decided there were a reason for normal backends to have a session-lifespan resowner. But even then, it might be better to distinguish that from aux processes' use of resowners. (I'm not really convinced that it'd be a good idea for normal backends to have a session-lifespan resowner; that could mask bugs involving trying to acquire resources outside a transaction.) regards, tom lane