MXS-199: Support Causal Read in Read Write Splitting (#164)

* MXS-199: Support Causal Read in Read Write Splitting

* move most causal read logic into rwsplit router and get server type from monitor

* misc fix: remove new line

* refactor, move config to right place, replace ltrim with gwbuf_consume

* refacter a little for previous commit

* fix code style
This commit is contained in:
dapeng
2018-02-05 15:09:18 +08:00
committed by Johan Wikman
parent 0696f3f60a
commit 8a0c8e63f2
9 changed files with 222 additions and 3 deletions

View File

@ -1232,6 +1232,9 @@ create_capabilities(MySQLProtocol *conn, bool with_ssl, bool db_specified, bool
/** add session track */
final_capabilities |= (uint32_t)GW_MYSQL_CAPABILITIES_SESSION_TRACK;
/** support multi statments */
final_capabilities |= (uint32_t)GW_MYSQL_CAPABILITIES_MULTI_STATEMENTS;
/* Compression is not currently supported */
ss_dassert(!compress);
if (compress)
@ -1809,7 +1812,11 @@ void mxs_mysql_parse_ok_packet(GWBUF *buff, size_t packet_offset, size_t packet_
case SESSION_TRACK_STATE_CHANGE:
case SESSION_TRACK_SCHEMA:
case SESSION_TRACK_GTIDS:
mxs_lestr_consume(&ptr, &size);
mxs_leint_consume(&ptr); // Length of the overall entity.
mxs_leint_consume(&ptr); // encoding specification
var_value = mxs_lestr_consume_dup(&ptr);
gwbuf_add_property(buff, (char *)"gtid", var_value);
MXS_FREE(var_value);
break;
case SESSION_TRACK_TRANSACTION_CHARACTERISTICS:
mxs_leint_consume(&ptr); //length