postgresql/src/bin/pg_basebackup
Robert Haas cc333f3233 Modify pg_basebackup to use a new COPY subprotocol for base backups.
In the new approach, all files across all tablespaces are sent in a
single COPY OUT operation. The CopyData messages are no longer raw
archive content; rather, each message is prefixed with a type byte
that describes its purpose, e.g. 'n' signifies the start of a new
archive and 'd' signifies archive or manifest data. This protocol
is significantly more extensible than the old approach, since we can
later create more message types, though not without concern for
backward compatibility.

The new protocol sends a few things to the client that the old one
did not. First, it sends the name of each archive explicitly, instead
of letting the client compute it. This is intended to make it easier
to write future patches that might send archives in a format other
that tar (e.g. cpio, pax, tar.gz). Second, it sends explicit progress
messages rather than allowing the client to assume that progress is
defined by the number of bytes received. This will help with future
features where the server compresses the data, or sends it someplace
directly rather than transmitting it to the client.

The old protocol is still supported for compatibility with previous
releases. The new protocol is selected by means of a new
TARGET option to the BASE_BACKUP command. Currently, the
only supported target is 'client'. Support for additional
targets will be added in a later commit.

Patch by me. The patch set of which this is a part has had review
and/or testing from Jeevan Ladhe, Tushar Ahuja, Suraj Kharage,
Dipesh Pandit, and Mark Dilger.

Discussion: http://postgr.es/m/CA+TgmoaYZbz0=Yk797aOJwkGJC-LK3iXn+wzzMx7KdwNpZhS5g@mail.gmail.com
2022-01-18 13:47:49 -05:00
..
po Translation updates 2021-06-21 12:33:50 +02:00
t tests: Consistently use pg_basebackup -cfast --no-sync to accelerate tests. 2022-01-17 15:43:35 -08:00
.gitignore Rename user-facing tools with "xlog" in the name to say "wal". 2017-02-09 16:23:46 -05:00
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00
bbstreamer.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
bbstreamer_file.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
bbstreamer_inject.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
bbstreamer_tar.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00
pg_basebackup.c Modify pg_basebackup to use a new COPY subprotocol for base backups. 2022-01-18 13:47:49 -05:00
pg_receivewal.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_recvlogical.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
receivelog.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
receivelog.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
streamutil.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
streamutil.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
walmethods.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
walmethods.h Update copyright for 2022 2022-01-07 19:04:57 -05:00