pgpool2.git / summary / log / commit / refs
commit f809426aaa416c6e1dfdda2e3aed3246442f13fb
Author: Yugo Nagata <nagata@sraoss.co.jp>
Date: Fri Sep 01 07:27:46 2017 +0000
Fix wd_authkey bug in that a request to add new node to the clusetr is rejected by master
This is a bug is due to the following commit.
commit 39de4a11d48b0ca50a4e8a9538265441994298b8
Author: Muhammad Usama <m.usama@gmail.com>
Date: Thu Mar 30 02:00:49 2017 +0500
Enhancing the handling of split-brain scenario by the watchdog.
This changed the definition of tv_sec that is used to check wd_authkey so
that this was affected by the clock of OS. So, if there is a lag between
two nodes' clocks, the wd_authkey check fails.
src/watchdog/watchdog.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c
index 093aa6360..ffaa4fad9 100644
--- a/src/watchdog/watchdog.c
+++ b/src/watchdog/watchdog.c
@@ -6814,8 +6814,8 @@ static bool get_authhash_for_node(WatchdogNode* wdNode, char* authhash)
if (strlen(pool_config->wd_authkey))
{
char nodeStr[WD_MAX_PACKET_STRING + 1];
- int len = snprintf(nodeStr, WD_MAX_PACKET_STRING, "state=%d tv_sec=%ld wd_port=%d",
- wdNode->state, wdNode->startup_time.tv_sec, wdNode->wd_port);
+ int len = snprintf(nodeStr, WD_MAX_PACKET_STRING, "state=%d wd_port=%d",
+ wdNode->state, wdNode->wd_port);
/* calculate hash from packet */
@@ -6835,8 +6835,8 @@ static bool verify_authhash_for_node(WatchdogNode* wdNode, char* authhash)
char calculated_authhash[WD_AUTH_HASH_LEN + 1];
char nodeStr[WD_MAX_PACKET_STRING];
- int len = snprintf(nodeStr, WD_MAX_PACKET_STRING, "state=%d tv_sec=%ld wd_port=%d",
- wdNode->state, wdNode->startup_time.tv_sec, wdNode->wd_port);
+ int len = snprintf(nodeStr, WD_MAX_PACKET_STRING, "state=%d wd_port=%d",
+ wdNode->state, wdNode->wd_port);
/* calculate hash from packet */
[parent: 4a1f269a74ca]