pgpool2.git / summary / log / commit / refs
commit 94ee9bef46c5dedc16337c4887b18cfb16058d81
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Fri Sep 28 07:47:03 2012 +0000
Fix oversight of get_next_master_node() when operated in raw mode.
If master node goes down, it always returned master node id 0.
See [pgpool-general: 1039] for more details.
main.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/main.c b/main.c
index 05ce218b3..acde42cce 100644
--- a/main.c
+++ b/main.c
@@ -1634,12 +1634,16 @@ static int get_next_master_node(void)
* node id. In other words, standby nodes are false. So need
* to check backend status with VALID_BACKEND_RAW.
*/
- if (RAW_MODE && VALID_BACKEND_RAW(i))
+ if (RAW_MODE)
{
+ if (VALID_BACKEND_RAW(i))
+ break;
+ }
+ else
+ {
+ if (VALID_BACKEND(i))
break;
}
- else if (VALID_BACKEND(i))
- break;
}
if (i == pool_config->backend_desc->num_backends)
[parent: 238b25183c54]