Re: base backup client as auxiliary backend process
Sergei Kornilov <sk@zsrv.org>
From: Sergei Kornilov <sk@zsrv.org>
To: Thomas Munro <thomas.munro@gmail.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-07-11T11:12:36Z
Lists: pgsql-hackers
Hello >> Attached is a very hackish patch to implement this. It works like this: >> >> # (assuming you have a primary already running somewhere) >> initdb -D data2 --minimal >> $EDITOR data2/postgresql.conf # set primary_conninfo >> pg_ctl -D data2 start > > +1, very nice. How about --replica? +1 Also not works with -DEXEC_BACKEND for me. > There is also the question what you do > if the base backup fails halfway through. Currently you probably need > to delete the whole data directory and start again with initdb. Better > might be a way to start again and overwrite any existing files, but that > can clearly also be dangerous. I think the need for delete directory and rerun initdb is better than overwrite files. - we need check major version. Basebackup can works with different versions, but would be useless to copying cluster which we can not run - basebackup silently overwrite configs (pg_hba.conf, postgresql.conf, postgresql.auto.conf) in $PGDATA. This is ok for pg_basebackup but not for backend process - I think we need start walreceiver. At best, without interruption during startup replay (if possible) > XXX Is there a use for > * switching into (non-standby) recovery here? I think not. regards, Sergei
Commits
-
Factor out InitControlFile() from BootStrapXLOG()
- 79c2385915dd 13.0 landed
-
Reformat code comment
- 9745f93afc56 13.0 landed
-
pg_resetwal: Rename function to avoid potential conflict
- 5f1b8260af96 13.0 landed
-
Expose PQbackendPID() through walreceiver API
- ee4ac46c8eb2 13.0 landed
-
walreceiver uses a temporary replication slot by default
- 329730827848 13.0 landed
-
Make lsn argument of walrcv_create_slot() optional
- c67a55da4ea0 13.0 landed
-
More precise errors from initial pg_control check
- b85e43feb3e8 13.0 landed