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

Alexey Kondratov <a.kondratov@postgrespro.ru>

From: Alexey Kondratov <a.kondratov@postgrespro.ru>
To: Liudmila Mantrova <l.mantrova@postgrespro.ru>, Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Andrey Borodin <x4mmm@yandex-team.ru>, David Steele <david@pgmasters.net>, Alvaro Herrera <alvherre@2ndquadrant.com>, 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: 2019-08-01T16:53:09Z
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

Attachments

On 26.07.2019 20:43, Liudmila Mantrova wrote:
>
> I would like to suggest a couple of changes to docs and comments, 
> please see the attachment.
> The "...or fetched on startup" part also seems wrong here, but it's 
> not a part of your patch, so I'm going to ask about it on psql-docs 
> separately.

Agreed, thank you a lot! Yes, "...or fetched on startup" looks a bit 
confusing for me, since the whole paragraph is about target server 
before running pg_rewind, but this statement is more about target server 
started first time after running pg_rewind, which is discussed in the 
next paragraph.

>
> It might also be useful to reword the following error messages:
> - "using restored from archive version of file \"%s\""
> - "could not open restored from archive file \"%s\"
> We could probably say something like "could not open file \"%s\" 
> restored from WAL archive" instead.

I have reworded these and some similar messages, thanks. New patch with 
changed messages is attached.

>
> On a more general note, I wonder if everyone is happy with the 
> --using-postgresql-conf option name, or we should continue searching 
> for a narrower term. Unfortunately, I don't have any better 
> suggestions right now, but I believe it should be clear that its 
> purpose is to fetch missing WAL files for target. What do you think?
>

I don't like it either, but this one was my best guess then. Maybe 
--restore-target-wal instead of --using-postgresql-conf will be better? 
And --target-restore-command instead of --restore-command if we want to 
specify that this is restore_command for target server?


Regards

-- 
Alexey Kondratov

Postgres Professional https://www.postgrespro.com
Russian Postgres Company