Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4bZu-0003sD-RA for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Apr 2018 00:19:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f4bZt-0001Jl-9g for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Apr 2018 00:19:33 +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.89) (envelope-from ) id 1f4bZs-0001Jb-VX for pgsql-hackers@lists.postgresql.org; Sat, 07 Apr 2018 00:19:33 +0000 Received: from bay.acenet.us ([173.230.252.50]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4bZq-0003RC-Jd for pgsql-hackers@postgresql.org; Sat, 07 Apr 2018 00:19:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:Cc:References:To:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8jLHfHSJAG0+vMZ+XcoHQE5j+cjGzdClrddSBjqIiWA=; b=IBqawPTFleIUGEYB1KPn97h0l wNR34TgaV5Gg3uPe8J9wuBo05AlJSwG2Rvvez2yVZ73AVCOic0VMJo2dnK+/jCtNqKi36ssrZVLET C8/ylXgIwQjLH3so4m4063Br1ll9Ti42/6y8rcdH0PwSZP3MUBPbqRxXQWm4/srBprORCiYBN/v97 6iGCloJZKiVkTI/KFQrzfi5/Jkxtu/P4u+tjr8S4zl2rG45u5mXC7qTpL1S2kix70KOFNHL1zMDN0 OHIVCGvI/7dM+jnLNezSYkIcQ5D6tclpfD3jt7rCPFc8F8n9g5ZsQ4hSbOeV4e9pNfw7mF/ckkfXF zU3gd/NRQ==; Received: from [192.182.57.106] (port=43933) by bay.acenet.us with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1f4bZo-002RMh-NY; Fri, 06 Apr 2018 20:19:29 -0400 Subject: Re: [PATCH] Update README for Resource Owners To: Andres Freund References: <5AC806D1.1090608@anastigmatix.net> <20180406235209.k2gfizjfi2xczo6z@alap3.anarazel.de> Cc: PostgreSQL Hackers From: Chapman Flack Message-ID: <5AC80E90.5000407@anastigmatix.net> Date: Fri, 6 Apr 2018 20:19:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <20180406235209.k2gfizjfi2xczo6z@alap3.anarazel.de> Content-Type: multipart/mixed; boundary="------------090105000607020506010908" X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap+anastigmatix.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------090105000607020506010908 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 04/06/18 19:52, Andres Freund wrote: > On 2018-04-06 19:46:25 -0400, Chapman Flack wrote: >> Hasn't been updated as built-in support grew for temp files, DSM segments, >> and JIT contexts. >> >> With enough luck, a README update won't break anything. > > Wouldn't it be a better idea not to have a list there, that's guaranteed > to get out of date? That might look like this, then. But I'm not sure how bad it is to have a list. How often does ResourceOwner get taught a new type? It took nine years to grow these last three. -Chap --------------090105000607020506010908 Content-Type: text/x-patch; name="0001-Update-README-for-Resource-Owners-v2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Update-README-for-Resource-Owners-v2.patch" From 56c047c5fa963c0c22affdde2ce669ed88693e5a Mon Sep 17 00:00:00 2001 From: Chapman Flack Date: Fri, 6 Apr 2018 20:16:42 -0400 Subject: [PATCH] Update README for Resource Owners. Built-in support for three more categories of owned object has accreted without mention in the README. --- src/backend/utils/resowner/README | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/backend/utils/resowner/README b/src/backend/utils/resowner/README index 2998f6b..c01f3bc 100644 --- a/src/backend/utils/resowner/README +++ b/src/backend/utils/resowner/README @@ -61,12 +61,16 @@ ResourceOwner transfers lock ownership to the parent instead of actually releasing the lock, if isCommit is true. Currently, ResourceOwners contain direct support for recording ownership of -buffer pins, lmgr locks, and catcache, relcache, plancache, tupdesc, and -snapshot references. Other objects can be associated with a ResourceOwner by -recording the address of the owning ResourceOwner in such an object. There is -an API for other modules to get control during ResourceOwner release, so that -they can scan their own data structures to find the objects that need to be -deleted. +several types of resource managed in the core, with the three operations +ResourceOwnerEnlargeRefs(), ResourceOwnerRememberRef(), and +ResourceOwnerForgetRef() for each type. The first ensures there is room +for at least one more entry of the type, and is separate from Remember... +so that out-of-memory can be detected before the resource is acquired. + +Other objects can be associated with a ResourceOwner by recording the address +of the owning ResourceOwner in such an object. There is an API for other +modules to get control during ResourceOwner release, so that they can scan +their own data structures to find the objects that need to be deleted. Whenever we are inside a transaction, the global variable CurrentResourceOwner shows which resource owner should be assigned -- 2.7.3 --------------090105000607020506010908--