mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
Enable pg_rewind to be used with PostgreSQL 9.3/9.4
pg_rewind is not part of the core distribution for those, but we provided support in repmgr 3.3 so should extend it to repmgr 4. Note that there is no check in place whether the pg_rewind binary exists, so it's up to the user to ensure it's present. Addresses GitHub #413.
This commit is contained in:
@@ -2771,7 +2771,7 @@ do_standby_switchover(void)
|
||||
* archived
|
||||
*/
|
||||
|
||||
if (runtime_options.force_rewind == true)
|
||||
if (runtime_options.force_rewind_used == true)
|
||||
{
|
||||
PQExpBufferData reason;
|
||||
PQExpBufferData msg;
|
||||
@@ -3578,7 +3578,7 @@ do_standby_switchover(void)
|
||||
* in pg_control, which is written at the first checkpoint, which might not
|
||||
* occur immediately.
|
||||
*/
|
||||
if (runtime_options.force_rewind == true)
|
||||
if (runtime_options.force_rewind_used == true)
|
||||
{
|
||||
log_notice(_("issuing CHECKPOINT"));
|
||||
checkpoint(local_conn);
|
||||
@@ -3595,7 +3595,7 @@ do_standby_switchover(void)
|
||||
KeyValueListCell *cell = NULL;
|
||||
bool first_entry = true;
|
||||
|
||||
if (runtime_options.force_rewind == false)
|
||||
if (runtime_options.force_rewind_used == false)
|
||||
{
|
||||
log_error(_("new primary diverges from former primary and --force-rewind not provided"));
|
||||
log_hint(_("the former primary will need to be restored manually, or use \"repmgr node rejoin\""));
|
||||
@@ -3605,7 +3605,16 @@ do_standby_switchover(void)
|
||||
}
|
||||
|
||||
appendPQExpBuffer(&node_rejoin_options,
|
||||
" --force-rewind --config-files=");
|
||||
" --force-rewind");
|
||||
|
||||
if (runtime_options.force_rewind_path[0] != '\0')
|
||||
{
|
||||
appendPQExpBuffer(&node_rejoin_options,
|
||||
"=%s",
|
||||
runtime_options.force_rewind_path);
|
||||
}
|
||||
appendPQExpBuffer(&node_rejoin_options,
|
||||
" --config-files=");
|
||||
|
||||
for (cell = remote_config_files.head; cell; cell = cell->next)
|
||||
{
|
||||
@@ -6315,7 +6324,9 @@ do_standby_help(void)
|
||||
printf(_(" --always-promote promote standby even if behind original primary\n"));
|
||||
printf(_(" --dry-run perform checks etc. but don't actually execute switchover\n"));
|
||||
printf(_(" -F, --force ignore warnings and continue anyway\n"));
|
||||
printf(_(" --force-rewind 9.5 and later - use pg_rewind to reintegrate the old primary if necessary\n"));
|
||||
printf(_(" --force-rewind[=VALUE] use \"pg_rewind\" to reintegrate the old primary if necessary\n"));
|
||||
printf(_(" (9.3 and 9.4 - provide \"pg_rewind\" path)\n"));
|
||||
|
||||
printf(_(" -R, --remote-user=USERNAME database server username for SSH operations (default: \"%s\")\n"), runtime_options.username);
|
||||
printf(_(" --siblings-follow have other standbys follow new primary\n"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user