Re: Two pg_rewind patches (auto generate recovery conf and ensure clean shutdown)

From: Paul Guo <pguo(at)pivotal(dot)io>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)postgresql(dot)org, Jimmy Yih <jyih(at)pivotal(dot)io>, Ashwin Agrawal <aagrawal(at)pivotal(dot)io>
Subject: Re: Two pg_rewind patches (auto generate recovery conf and ensure clean shutdown)
Date: 2019-04-19 03:40:04
Message-ID: CAEET0ZHRbn7ROSRCf-CV8Vp1QL+baTxd4=Ong1Dr7A0OuBzmyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Michael,

I updated the patches as attached following previous discussions.

The two patches:
v2-0001-Extact-common-functions-from-pg_basebackup-into-s.patch
v2-0002-Add-option-to-write-recovery-configuration-inform.patch

1. 0001 does move those common functions & variables to two new files (one
.c and one .h) for both pg_rewind and pg_basebackup use,
note the functions are slightly modified (e.g. because conn is probably
NULL on pg_rewind). I do not know where is more proper to put the
new files. Currently, they are under pg_basebackup and are used in
pg_rewind (Makefile modified to support that).

2. 0002 adds the option to write recovery conf.

The below patch runs single mode Postgres if needed to make sure the target
is cleanly shutdown. A new option is added (off by default).
v2-0001-Ensure-target-clean-shutdown-at-beginning-of-pg_r.patch

I've manually tested them and installcheck passes.

Thanks.

On Wed, Mar 20, 2019 at 1:23 PM Paul Guo <pguo(at)pivotal(dot)io> wrote:

>
>
> On Wed, Mar 20, 2019 at 1:20 PM Michael Paquier <michael(at)paquier(dot)xyz>
> wrote:
>
>> On Wed, Mar 20, 2019 at 12:48:52PM +0800, Paul Guo wrote:
>> > This is a good suggestion also. Will do it.
>>
>> Please note also that we don't care about recovery.conf since v12 as
>> recovery parameters are now GUCs. I would suggest appending those
>> extra parameters to postgresql.auto.conf, which is what pg_basebackup
>> does.
>>
> Yes, the recovery conf patch in the first email did like this, i.e.
> writing postgresql.auto.conf & standby.signal
>
>

Attachment Content-Type Size
v2-0001-Ensure-target-clean-shutdown-at-beginning-of-pg_r.patch application/octet-stream 4.5 KB
v2-0001-Extact-common-functions-from-pg_basebackup-into-s.patch application/octet-stream 17.1 KB
v2-0002-Add-option-to-write-recovery-configuration-inform.patch application/octet-stream 2.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-04-19 03:41:30 Re: Race conditions with checkpointer and shutdown
Previous Message Etsuro Fujita 2019-04-19 03:15:11 Re: bug in update tuple routing with foreign partitions