diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pcp_con/recovery.c | 2 | ||||
-rw-r--r-- | src/watchdog/watchdog.c | 10 | ||||
-rw-r--r-- | src/watchdog/wd_lifecheck.c | 11 |
3 files changed, 19 insertions, 4 deletions
diff --git a/src/pcp_con/recovery.c b/src/pcp_con/recovery.c index 8ad4a2fd5..84e4ddc17 100644 --- a/src/pcp_con/recovery.c +++ b/src/pcp_con/recovery.c @@ -482,7 +482,7 @@ connect_backend_libpq(BackendInfo *backend) port_str, NULL, NULL, - pool_config->recovery_database, + dbname, pool_config->recovery_user, password ? password : ""); diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c index d57d83526..31aec1735 100644 --- a/src/watchdog/watchdog.c +++ b/src/watchdog/watchdog.c @@ -1983,6 +1983,10 @@ read_sockets(fd_set *rmask, int pending_fds_count) return count; } +/* + * write watchdog IP command along with result data + * returns true on success + */ static bool write_ipc_command_with_result_data(WDCommandData *ipcCommand, char type, char *data, int len) { @@ -2133,7 +2137,7 @@ read_ipc_socket_and_process(int sock, bool *remove_socket) data_len = strlen(data) + 1; } - if (write_ipc_command_with_result_data(ipcCommand, res_type, data, data_len)) + if (!write_ipc_command_with_result_data(ipcCommand, res_type, data, data_len)) { ereport(NOTICE, (errmsg("error writing to IPC socket"))); @@ -3691,6 +3695,10 @@ update_successful_outgoing_cons(fd_set *wmask, int pending_fds_count) return count; } +/* + * write packet to watchdog communication socket + * returns true on success. + */ static bool write_packet_to_socket(int sock, WDPacketData *pkt, bool ipcPacket) { diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c index b62a9b493..5830d82af 100644 --- a/src/watchdog/wd_lifecheck.c +++ b/src/watchdog/wd_lifecheck.c @@ -642,7 +642,14 @@ load_watchdog_nodes_from_json(char *json_data, int len) json_value_free(root); } - +/*---------- + * is_wd_lifecheck_ready + * + * Check all registered watchdog nodes and returns WD_OK if: + * query mode: wd_ping_pgpool returns WD_OK + * hearbeat mode: has received from and + * sent to all node the heartbeat message + */ static int is_wd_lifecheck_ready(void) { @@ -680,7 +687,7 @@ is_wd_lifecheck_ready(void) { ereport(DEBUG1, (errmsg("watchdog checking life check is ready"), - errdetail("pgpool:%d at \"%s:%d\" has not send the heartbeat signal yet", + errdetail("pgpool:%d at \"%s:%d\" has not received from or sent to the heartbeat signal yet", i, node->hostName, node->pgpoolPort))); rtn = WD_NG; } |