Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGL9Q-0003Az-Oo for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2020 11:54:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kGL9P-0000lX-CG for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2020 11:54:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGL9P-0000lQ-5C for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2020 11:54:03 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGL9L-0002Uo-OZ for pgsql-hackers@postgresql.org; Thu, 10 Sep 2020 11:54:02 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id 6C6B7622C6; Thu, 10 Sep 2020 20:53:53 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 10 Sep 2020 20:53:53 +0900 From: torikoshia To: "Tomas Vondra Kasahara Tatsuhito" Cc: Tom Lane , PostgreSQL-development Subject: Re: Get memory contexts of an arbitrary backend process In-Reply-To: <20200904124619.k2dgu7dty7awb6cu@development> References: <0271f440ac77f2a4180e0e56ebd944d1@oss.nttdata.com> <4a39f13d6496ea4686bbac4254154fe8@oss.nttdata.com> <640735.1599154807@sss.pgh.pa.us> <20200904124619.k2dgu7dty7awb6cu@development> Message-ID: <8865138e1c262d54e8a67a71b4a538aa@oss.nttdata.com> X-Sender: torikoshia@oss.nttdata.com User-Agent: Roundcube Webmail/1.1.9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-09-04 21:46, Tomas Vondra wrote: > On Fri, Sep 04, 2020 at 11:47:30AM +0900, Kasahara Tatsuhito wrote: >> On Fri, Sep 4, 2020 at 2:40 AM Tom Lane wrote: >>> Kasahara Tatsuhito writes: >>> > Yes, but it's not only for future expansion, but also for the >>> > usability and the stability of this feature. >>> > For example, if you want to read one dumped file multiple times and analyze it, >>> > you will want the ability to just read the dump. >>> >>> If we design it to make that possible, how are we going to prevent >>> disk >>> space leaks from never-cleaned-up dump files? >> In my thought, with features such as a view that allows us to see a >> list of dumped files, >> it would be better to have a function that simply deletes the dump >> files associated with a specific PID, >> or to delete all dump files. >> Some files may be dumped with unexpected delays, so I think the >> cleaning feature will be necessary. >> ( Also, as the pgsql_tmp file, it might better to delete dump files >> when PostgreSQL start.) >> >> Or should we try to delete the dump file as soon as we can read it? >> > > IMO making the cleanup a responsibility of the users (e.g. by exposing > the list of dumped files through a view and expecting users to delete > them in some way) is rather fragile. > > I don't quite see what's the point of designing it this way. It was > suggested this improves stability and usability of this feature, but > surely making it unnecessarily complex contradicts both points? > > IMHO if the user needs to process the dump repeatedly, what's > preventing > him/her from storing it in a file, or something like that? At that > point > it's clear it's up to them to remove the file. So I suggest to keep the > feature as simple as possible - hand the dump over and delete. +1. If there are no other objections, I'm going to accept this suggestion. Regards