Re: Two pg_rewind patches (auto generate recovery conf and ensure clean shutdown)
Paul Guo <pguo@pivotal.io>
From: Paul Guo <pguo@pivotal.io>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@postgresql.org, Jimmy Yih <jyih@pivotal.io>,
Ashwin Agrawal <aagrawal@pivotal.io>
Date: 2019-04-19T03:40:04Z
Lists: pgsql-hackers
Attachments
- v2-0001-Ensure-target-clean-shutdown-at-beginning-of-pg_r.patch (application/octet-stream) patch v2-0001
- v2-0001-Extact-common-functions-from-pg_basebackup-into-s.patch (application/octet-stream) patch v2-0001
- v2-0002-Add-option-to-write-recovery-configuration-inform.patch (application/octet-stream) patch v2-0002
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@pivotal.io> wrote: > > > On Wed, Mar 20, 2019 at 1:20 PM Michael Paquier <michael@paquier.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 > >
Commits
-
Improve test coverage of pg_rewind
- 55ba56415bae 13.0 landed
-
Improve handling and coverage of --no-ensure-shutdown in pg_rewind
- caa078353ecd 13.0 landed
-
Fix issues in pg_rewind with --no-ensure-shutdown/--write-recovery-conf
- 6837632b758e 13.0 landed
-
Fix --dry-run mode of pg_rewind
- c2e3b311d9ef 12.1 landed
- 6f3823b03560 13.0 landed
-
pg_rewind: test new --write-recovery-conf functionality
- 7524c788743f 13.0 landed
-
pg_rewind: Allow writing recovery configuration
- 927474ce1a24 13.0 landed
-
Have pg_rewind run crash recovery before rewinding
- 5adafaf176d0 13.0 landed
-
Split out recovery confing-writing code from pg_basebackup
- caba97a9d9f4 13.0 landed
-
Switch TAP tests of pg_rewind to use non-superuser role, take two
- d9f543e9e9be 12.0 cited