Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Alexey Kondratov <a.kondratov@postgrespro.ru>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Kuntal Ghosh <kuntalghosh.2007@gmail.com>, Liudmila Mantrova <l.mantrova@postgrespro.ru>, Thomas Munro <thomas.munro@gmail.com>, Andrey Borodin <x4mmm@yandex-team.ru>, David Steele <david@pgmasters.net>, Andres Freund <andres@anarazel.de>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Dmitry Dolgov <9erthalion6@gmail.com>, vladimirlesk@yandex-team.ru, dsarafan@yandex-team.ru
Date: 2020-06-09T02:40:44Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Move frontend-side archive APIs from src/common/ to src/fe_utils/

  2. Add -c/--restore-target-wal to pg_rewind

  3. Move routine definitions of xlogarchive.c to a new header file

  4. Move routine building restore_command to src/common/

  5. Integrate recovery.conf into postgresql.conf

On Mon, Jun 08, 2020 at 02:16:32PM +0300, Alexey Kondratov wrote:
> BTW, most of 'common' is a really common code with only four exceptions
> like logging.c, which is frontend-only. Is it there for historical
> reasons only or something else?"
> 
> Personally, I would prefer that everything in the 'common' was actually
> common. I also do not sure about moving an older code, because of possible
> backward compatibility breakage, but doing so for a newer one seems to be a
> good idea.

src/fe_utils/ has been created much after src/common/ (588d963 vs
8396447).  I got to wonder if we should add a note to src/common/'s 
Makefile to not add more stuff to OBJS_FRONTEND and just tell to use
src/fe_utils/.  Moving things from common/ to fe_utils/ would mean
breakages, which may be hard to justify just for the sake of being
clean and more consistent, and src/common/ APIs are usually quite
popular with external plugins.
--
Michael