On Sat, Jan 18, 2020 at 06:21:22PM +0300, Alexander Korotkov wrote: > I made some minor cleanup. In particular, I've to fix usage of terms > "WAL" and "WALs". This patch sometimes use term "WAL" to specify > single WAL file and term "WALs" to specify multiple WAL files. But > WAL stands for Write Ahead Log. So, "WALs" literally stands to > multiple logs. And we don't use term "WALs" to describe multiple WAL > files anywhere else. Usage of term "WAL" to describe single file is > not clear as well.
WAL is a method to ensure data integrity, as the docs mention: https://www.postgresql.org/docs/11/wal-intro.html So using WAL to tell about a WAL segment file is wrong, WALs is not a term that actually exists. So, in my opinion, it is fine to use "WAL file", "WAL segment" or even "WAL segment file". I have read through the patch, while on it.. +static int +RestoreArchivedWALFile(const char *path, const char *xlogfname, + off_t expectedSize, const char *restoreCommand) Not a fan of putting that to pg_rewind/parsexlog.c. It has nothing to do with WAL parsing, and it seems to me that we could have an argument for making this available as a frontend-only API in src/common/. Do we actually need --target-restore-command at all? It seems to me that we have all we need with --restore-target-wal, and that's not really instinctive to pass down a command via another command.. + printf(_(" -c, --restore-target-wal use restore_command in the postgresql.conf\n")); + printf(_(" to retrieve WAL files from archive\n")); The command could be part of a different configuration file, included by postgresql.conf. +use File::Glob ':bsd_glob'; +use File::Path qw(remove_tree make_path); +use File::Spec::Functions qw(catdir catfile); Is this compatible with our minimum perl requirements for the TAP tests? + # Add restore_command to postgresql.conf of target cluster. + open(my $conf_fd, ">>", $master_conf_path) or die; + print $conf_fd "\nrestore_command='$restore_command'"; + close $conf_fd; We have append_conf() for that. -- Michael
signature.asc
Description: PGP signature