mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
Add -X stream parameter to pg_basebackup to ensure that we get
all the WALs needed without needing to set wal_keep_segments to a ridiculously high value. This is not necessary on 9.6 if we are using replication slots, as all WAL segments needed will be kept on the primary until they are consumed by the slot.
This commit is contained in:
14
repmgr.c
14
repmgr.c
@@ -4414,6 +4414,18 @@ run_basebackup(const char *data_dir)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* To ensure we have all the WALs needed during basebackup execution we stream
|
||||
* them as the backup is taking place.
|
||||
* Not necessary if on 9.6 if we have replication slots set in repmgr.conf
|
||||
* (starting at 9.6 there is an option, which we use, to reserve the LSN at
|
||||
* creation time)
|
||||
*/
|
||||
if (server_version_num < 90600 || !options.use_replication_slots)
|
||||
{
|
||||
appendPQExpBuffer(¶ms, " -X stream");
|
||||
}
|
||||
|
||||
maxlen_snprintf(script,
|
||||
"%s -l \"repmgr base backup\" %s %s",
|
||||
make_pg_path("pg_basebackup"),
|
||||
@@ -4426,7 +4438,7 @@ run_basebackup(const char *data_dir)
|
||||
|
||||
/*
|
||||
* As of 9.4, pg_basebackup only ever returns 0 or 1
|
||||
*/
|
||||
*/
|
||||
|
||||
r = system(script);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user