diff --git a/dbutils.c b/dbutils.c index 873a60e6..0cbae2d7 100644 --- a/dbutils.c +++ b/dbutils.c @@ -3552,11 +3552,21 @@ witness_copy_node_records(PGconn *primary_conn, PGconn *witness_conn) return false; } - get_all_node_records(primary_conn, &nodes); + if (get_all_node_records(primary_conn, &nodes) == false) + { + rollback_transaction(witness_conn); + + return false; + } for (cell = nodes.head; cell; cell = cell->next) { - create_node_record(witness_conn, NULL, cell->node_info); + if (create_node_record(witness_conn, NULL, cell->node_info) == false) + { + rollback_transaction(witness_conn); + + return false; + } } /* and done */ diff --git a/repmgrd-physical.c b/repmgrd-physical.c index 1901d729..e11c3f90 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -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 */