]> granicus.if.org Git - postgresql/commit
Allow pg_basebackup to stream transaction log in tar mode
authorMagnus Hagander <magnus@hagander.net>
Sun, 23 Oct 2016 13:16:31 +0000 (15:16 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sun, 23 Oct 2016 13:23:11 +0000 (15:23 +0200)
commit56c7d8d4552180fd66fe48423bb2a9bb767c2d87
tree72a159d220c25c33363addd097ea719f8384dd52
parent1885c88459698251eca64f095d9942c540ba0fa8
Allow pg_basebackup to stream transaction log in tar mode

This will write the received transaction log into a file called
pg_wal.tar(.gz) next to the other tarfiles instead of writing it to
base.tar. When using fetch mode, the transaction log is still written to
base.tar like before, and when used against a pre-10 server, the file
is named pg_xlog.tar.

To do this, implement a new concept of a "walmethod", which is
responsible for writing the WAL. Two implementations exist, one that
writes to a plain directory (which is also used by pg_receivexlog) and
one that writes to a tar file with optional compression.

Reviewed by Michael Paquier
doc/src/sgml/ref/pg_basebackup.sgml
src/bin/pg_basebackup/Makefile
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_receivexlog.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_basebackup/receivelog.h
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_basebackup/walmethods.c [new file with mode: 0644]
src/bin/pg_basebackup/walmethods.h [new file with mode: 0644]
src/include/pgtar.h
src/port/tar.c