Allow master changes at transaction start

When a BEGIN statement is being executed without a master connection but
when one can be created, the BEGIN statement would be treated as if a
transaction was already open. Since the statement only starts the
transaction, it is allowed to be routed to a "new" master regardless of
the transaction statem.

This fixes the failure to start a transaction when lazy_connect is
enabled.
This commit is contained in:
Markus Mäkelä
2019-05-07 12:43:58 +03:00
parent ef25eceb78
commit b0d8535ead
2 changed files with 8 additions and 1 deletions

View File

@ -166,6 +166,7 @@ private:
bool create_one_connection();
void retry_query(GWBUF* querybuf, int delay = 1);
bool trx_is_starting();
bool should_replace_master(mxs::RWBackend* target);
void replace_master(mxs::RWBackend* target);
bool should_migrate_trx(mxs::RWBackend* target);