Track session state only when required

The protocol should not track the session state as the parsing is quite
expensive with the current code. This change is a workaround that enables
the parsing only when required. A proper way to handle this would be to do
all the response processing in one place thus avoiding the duplication of
work.
This commit is contained in:
Markus Mäkelä
2019-03-05 12:24:15 +02:00
parent b97976c4ee
commit 5b43940559
5 changed files with 16 additions and 2 deletions

View File

@ -280,6 +280,11 @@ bool RWSplitSession::route_single_stmt(GWBUF* querybuf)
}
else if (TARGET_IS_MASTER(route_target))
{
if (m_config.causal_reads)
{
gwbuf_set_type(querybuf, GWBUF_TYPE_TRACK_STATE);
}
succp = handle_master_is_target(&target);
if (!succp && should_migrate_trx(target))