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 1pxOXJ-0000Ji-EL for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2023 08:54:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pxOXH-0005ml-4M for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2023 08:53:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxOXG-0005mV-RT for pgsql-hackers@lists.postgresql.org; Fri, 12 May 2023 08:53:58 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pxOX8-001u44-S5 for pgsql-hackers@postgresql.org; Fri, 12 May 2023 08:53:56 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 759D660134; Fri, 12 May 2023 17:53:45 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 12 May 2023 17:53:45 +0900 From: torikoshia To: Bharath Rupireddy Cc: Michael Paquier , Kyotaro Horiguchi , pgsql-hackers@postgresql.org Subject: Re: Allow pg_archivecleanup to remove backup history files In-Reply-To: References: <20230425.172948.1630351042955772893.horikyota.ntt@gmail.com> <5adce8cd5ad2269fe687d2d56a341c88@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <61abc656edfba4a668b367d590b1aaab@oss.nttdata.com> X-Sender: torikoshia@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-05-10 17:52, Bharath Rupireddy wrote: Thanks for your comments! > Just curious to know the driving point behind this proposal - is > pg_archivecleanup deployed in production that was unable to clean up > the history files and there were many such history files left? It will > help us know how pg_archivecleanup is being used. Yes. > Just curious to know the driving point behind this proposal - is > pg_archivecleanup deployed in production that was unable to clean up > the history files and there were many such history files left? It will > help us know how pg_archivecleanup is being used. > > I'm wondering if making -x generic with '-x' '.backup', is simpler > than adding another option? Since according to the current semantics, deleting backup history files with -x demands not '-x .backup' but '-x .007C9330.backup' when the file name is 0000000100001234000055CD.007C9330.backup, it needs special treatment for backup history files, right? I think it would be intuitive and easier to remember than new option. I was a little concerned about what to do when deleting both the files ending in .gz and backup history files. Is making it possible to specify both "-x .backup" and "-x .gz" the way to go? I also concerned someone might add ".backup" to WAL files, but does that usually not happen? > Comments on the patch: > 1. Why just only the backup history files? Why not remove the timeline > history files too? Is it because there may not be as many tli switches > happening as backups? Yeah, do you think we should also add logic for '-x .history'? > 2.+sub remove_backuphistoryfile_run_check > +{ > Why to invent a new function when run_check() can be made generic with > few arguments passed? Thanks, I'm going to reconsider it. -- Regards, -- Atsushi Torikoshi NTT DATA CORPORATION