diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/protocol/child.c | 5 | ||||
-rw-r--r-- | src/watchdog/wd_lifecheck.c | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/protocol/child.c b/src/protocol/child.c index cf2161806..87de2caac 100644 --- a/src/protocol/child.c +++ b/src/protocol/child.c @@ -772,8 +772,11 @@ read_startup_packet(POOL_CONNECTION *cp) } /* The database defaults to their user name. */ - if (sp->database == NULL || sp->database[0] == '\0') + if (sp->database == NULL) + sp->database = pstrdup(sp->user); + else if (sp->database[0] == '\0') { + pfree(sp->database); sp->database = pstrdup(sp->user); } 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; } |