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 1nHnE1-0006LE-1T for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Feb 2022 13:41:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nHnDz-0006CF-2V for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Feb 2022 13:41:35 +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 1nHnDy-0006C6-PT for pgsql-hackers@lists.postgresql.org; Wed, 09 Feb 2022 13:41:34 +0000 Received: from pitta.toroid.org ([136.243.148.74]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nHnDw-0006L4-5t for pgsql-hackers@postgresql.org; Wed, 09 Feb 2022 13:41:34 +0000 Received: from ullu.lweshal.in (unknown [10.1.1.2]) by pitta.toroid.org (Postfix) with ESMTP id 3DDCEFA34F7; Wed, 9 Feb 2022 14:41:30 +0100 (CET) Received: from ams by ullu.lweshal.in with local (Exim 4.94.2) (envelope-from ) id 1nHnDr-008nU7-MG; Wed, 09 Feb 2022 19:11:27 +0530 Date: Wed, 9 Feb 2022 19:11:27 +0530 From: Abhijit Menon-Sen To: Robert Haas Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Jeevan Ladhe , Mark Dilger , pgsql-hackers@postgresql.org, tushar Subject: Re: refactoring basebackup.c Message-ID: References: <20211115162641.dmo6l32fklh64gnw@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At 2022-02-02 10:55:53 -0500, robertmhaas@gmail.com wrote: > > On Tue, Jan 18, 2022 at 1:55 PM Robert Haas wrote: > > 0001 adds "server" and "blackhole" as backup targets. It now has some > > tests. This might be more or less ready to ship, unless somebody else > > sees a problem, or I find one. > > I played around with this a bit and it seems quite easy to extend this > further. So please find attached a couple more patches to generalize > this mechanism. It took me a while to assimilate these patches, including the backup targets one, which I hadn't looked at before. Now that I've wrapped my head around how to put the pieces together, I really like the idea. As you say, writing non-trivial integrations in C will take some effort, but it seems worthwhile. It's also nice that one can continue to use pg_basebackup to trigger the backups and see progress information. > Granted, coding up a new base backup target is > something only experienced C hackers are likely to do, but the fact > that I was able to throw this together so quickly suggests to me that > I've got the design basically right, and that anyone who does want to > plug into the new mechanism shouldn't have too much trouble doing so. > > Thoughts? Yes, it looks simple to follow the example set by basebackup_to_shell to write a custom target. The complexity will be in whatever we need to do to store/forward the backup data, rather than in obtaining the data in the first place, which is exactly as it should be. Thanks! -- Abhijit