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.
{
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.
*/
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;