pgpool2.git / summary / log / commit / refs

commit    4139329b7729892d57c164f192a0ba23e22b7bc3
Author:   at.mitani <at.mitani@gmail.com>
Date:     Thu Jun 14 08:42:43 2012 +0000

    fixed delegate IP restart problem.


watchdog/wd_if.c | 13 +++++++++++-- watchdog/wd_packet.c | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/watchdog/wd_if.c b/watchdog/wd_if.c index 223260bc2..667c8db43 100644 --- a/watchdog/wd_if.c +++ b/watchdog/wd_if.c @@ -38,19 +38,28 @@ int wd_IP_up(void); int wd_IP_down(void); static int exec_ifconfig(char * command); +static int ip_flg = 0; int wd_IP_up(void) { int rtn; - rtn = exec_ifconfig(pool_config->if_up_cmd); + if (ip_flg == 0) + { + rtn = exec_ifconfig(pool_config->if_up_cmd); + } + ip_flg = 1; return rtn; } int wd_IP_down(void) { int rtn; - rtn = exec_ifconfig(pool_config->if_down_cmd); + if (ip_flg == 1) + { + rtn = exec_ifconfig(pool_config->if_down_cmd); + } + ip_flg = 0; return rtn; } diff --git a/watchdog/wd_packet.c b/watchdog/wd_packet.c index 449a8f9bb..57ee7f47c 100644 --- a/watchdog/wd_packet.c +++ b/watchdog/wd_packet.c @@ -604,11 +604,11 @@ send_packet_4_nodes(WdPacket *packet, WD_SEND_TYPE type) p++; } - if ((type == WD_SEND_TO_MASTER) && (cnt == 0)) + pthread_attr_destroy(&attr); + if (cnt == 0) { return WD_OK; } - pthread_attr_destroy(&attr); rtn = (packet->packet_no == WD_STAND_FOR_MASTER)?WD_OK:WD_NG; for (i=0; i<cnt; ) { [parent: dca9ee1d5342]