MXS-1503: Fix read-only mode regression
The master_failure_mode=error_on_write mode was broken due to a faulty assumption that all successfully routed queries would produce a target. This is not the case when a write in error_on_write mode is received.
This commit is contained in:
@ -212,9 +212,14 @@ bool route_single_stmt(RWSplit *inst, RWSplitSession *rses, GWBUF *querybuf, con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (succp && target && prepare_target(rses, target, route_target))
|
if (succp && target)
|
||||||
{
|
{
|
||||||
if (target->session_command_count())
|
if (!prepare_target(rses, target, route_target))
|
||||||
|
{
|
||||||
|
// The connection to target was down and we failed to reconnect
|
||||||
|
succp = false;
|
||||||
|
}
|
||||||
|
else if (target->session_command_count())
|
||||||
{
|
{
|
||||||
// We need to wait until the session commands are executed
|
// We need to wait until the session commands are executed
|
||||||
rses->expected_responses++;
|
rses->expected_responses++;
|
||||||
@ -237,10 +242,6 @@ bool route_single_stmt(RWSplit *inst, RWSplitSession *rses, GWBUF *querybuf, con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
succp = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (succp && inst->config().connection_keepalive &&
|
if (succp && inst->config().connection_keepalive &&
|
||||||
|
Reference in New Issue
Block a user