pgpool2.git / summary / log / commit / refs
commit ad211b91efadebe35eac629e61e865281040702b
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Wed May 22 22:34:03 2019 +0000
Make failover in progress check more aggressively.
In pool_virtual_master_db_node_id() the case when session context is
not available was not covered by the failover in progress checking
because I thought it'd be too aggressive. However a report from field
showed that that could happen while authenticating a client (and it
causes a segfault). So I decided to move the check to beginning of the
function to cover the case.
src/context/pool_query_context.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/context/pool_query_context.c b/src/context/pool_query_context.c
index 837fb01af..01024137e 100644
--- a/src/context/pool_query_context.c
+++ b/src/context/pool_query_context.c
@@ -312,12 +312,6 @@ pool_virtual_master_db_node_id(void)
{
POOL_SESSION_CONTEXT *sc;
- sc = pool_get_session_context(true);
- if (!sc)
- {
- return REAL_MASTER_NODE_ID;
- }
-
/*
* Check whether failover is in progress. If so, just abort this session.
*/
@@ -332,6 +326,12 @@ pool_virtual_master_db_node_id(void)
child_exit(POOL_EXIT_AND_RESTART);
}
+ sc = pool_get_session_context(true);
+ if (!sc)
+ {
+ return REAL_MASTER_NODE_ID;
+ }
+
if (sc->in_progress && sc->query_context)
{
int node_id = sc->query_context->virtual_master_node_id;
[parent: 82b5392bd84f]