Re: refactoring basebackup.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
Subject: Re: refactoring basebackup.c
Date: 2021-07-21 16:21:01
Message-ID: CA+TgmoZbLCO90b9eFb7Vkz1SbLjJ_J9v2ttL0xmOAx=qaD_mtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 21, 2021 at 12:11 PM Mark Dilger
<mark(dot)dilger(at)enterprisedb(dot)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 a callback which sets up the injector, rather than having CreateBackupStreamer do it directly. Even then, having now studied CreateBackupStreamer a bit more, the idea seems less appealing than it did initially. I don't think it makes things any 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2021-07-21 16:41:53 Re: speed up verifying UTF-8
Previous Message Robert Haas 2021-07-21 16:15:41 Re: Parallel scan with SubTransGetTopmostTransaction assert coredump