Re: refactoring basebackup.c - Mailing list pgsql-hackers

From Robert Haas
Subject Re: refactoring basebackup.c
Date
Msg-id CA+TgmoZbLCO90b9eFb7Vkz1SbLjJ_J9v2ttL0xmOAx=qaD_mtw@mail.gmail.com
Whole thread Raw
In response to Re: refactoring basebackup.c  (Mark Dilger <mark.dilger@enterprisedb.com>)
List pgsql-hackers
On Wed, Jul 21, 2021 at 12:11 PM Mark Dilger
<mark.dilger@enterprisedb.com> wrote:
> If you were going to support lots of formats, not just tar, you might want the streamer class for each format to have
acallback which sets up the injector, rather than having CreateBackupStreamer do it directly.  Even then, having now
studiedCreateBackupStreamer a bit more, the idea seems less appealing than it did initially.  I don't think it makes
thingsany cleaner when only supporting tar, and maybe not even when supporting multiple formats, so I'll withdraw the
suggestion.

Gotcha. I think if we had a lot of formats I'd probably make a
separate function where you passed in the file extension and archive
type and it hands you back a parser for the appropriate kind of
archive, or something like that. And then maybe a second, similar
function where you pass in the injector and archive type and it wraps
an archiver of the right type around it and hands that back. But I
don't think that's worth doing until we have 2 or 3 formats, which may
or may not happen any time in the forseeable future.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Next
From: John Naylor
Date:
Subject: Re: speed up verifying UTF-8