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

@ -75,6 +75,12 @@ typedef struct server_version
uint32_t patch;
} SERVER_VERSION;
typedef enum
{
SERVER_TYPE_MARIADB,
SERVER_TYPE_MYSQL
} server_type_t;
static inline void server_decode_version(uint64_t version, SERVER_VERSION* server_version)
{
uint32_t major = version / 10000;
@ -120,6 +126,7 @@ typedef struct server
struct server *nextdb; /**< Next server in list attached to a service */
char version_string[MAX_SERVER_VERSION_LEN]; /**< Server version string, i.e. MySQL server version */
uint64_t version; /**< Server version */
server_type_t server_type; /**< Server type */
long node_id; /**< Node id, server_id for M/S or local_index for Galera */
int rlag; /**< Replication Lag for Master / Slave replication */
unsigned long node_ts; /**< Last timestamp set from M/S monitor module */