repmgrd: minor tweaks to witness node synchronisation

Explicitly roll back if any operation fails, and add debugging output
to track elapsed time between synchronisation intervals.
This commit is contained in:
Ian Barwick
2020-09-01 09:58:14 +09:00
parent 1131e3aad2
commit a88c80248c
2 changed files with 19 additions and 2 deletions

View File

@@ -2300,6 +2300,7 @@ monitor_streaming_witness(void)
{
log_warning(_("unable to connect to primary"));
log_detail("\n%s", PQerrorMessage(primary_conn));
/*
* Here we're unable to connect to a primary despite having scanned all
* known nodes, so we'll grab the record of the node we think is primary
@@ -2672,6 +2673,12 @@ loop:
INSTR_TIME_SET_CURRENT(witness_sync_interval_start);
}
else
{
log_debug("seconds since last node record sync: %i (sync interval: %i)",
witness_sync_interval_elapsed,
config_file_options.witness_sync_interval)
}
}
/* emit "still alive" log message at regular intervals, if requested */