Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line
Date
Msg-id 20200608061452.GB2589@paquier.xyz
Whole thread Raw
In response to Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line
List pgsql-hackers
On Sun, Jun 07, 2020 at 10:05:03PM +0300, Alexander Korotkov wrote:
> On Sat, Jun 6, 2020 at 8:49 PM Peter Eisentraut
> <peter.eisentraut@2ndquadrant.com> wrote:
>> Why is fe_archive.c in src/common/ and not in src/fe_utils/?  It is not
>> "common" to frontend and backend.
>
> Yep, this seems wrong to me.  I can propose following file rename.
>
> src/common/fe_archive.c => src/fe_utils/archive.c
> include/common/fe_archive.h => include/fe_utils/archive.h

Is it technically a problem though?  fe_archive.c is listed as a
frontend-only file with OBJS_FRONTEND in src/common/Makefile.  Anyway,
for this one I would not mind to do the move so please see the
attached, but I am not completely sure either why src/fe_utils/ had
better be chosen than src/common/.

>> It actually defines functions that clash with functions in the backend,
>> so this seems doubly wrong.
>
> Let's have frontend version of RestoreArchivedFile() renamed as well.
> What about RestoreArchivedFileFrontend()?

-1 from me for the renaming, which was intentional to ease grepping
with the backend counterpart.  We have other cases like that, say
palloc(), fsync_fname(), etc.

Perhaps we have more things that are frontend-only in src/common/ that
could be moved to src/fe_utils/?  I am looking at restricted_token.c,
fe_memutils.c, logging.c and file_utils.c here, but that would mean
breaking a couple of declarations, something never free for plugin
developers.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: BufFileRead() error signalling
Next
From: Peter Eisentraut
Date:
Subject: Re: snowball release