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:
@ -423,4 +423,16 @@ extern void dprintAllBuffers(void *pdcb);
|
||||
*/
|
||||
void gwbuf_hexdump(GWBUF* buffer);
|
||||
|
||||
/**
|
||||
* Return pointer of the byte at offset from start of chained buffer
|
||||
* Warning: It not guaranteed to point to a contiguous segment of memory,
|
||||
* it is only safe to modify the first byte this pointer point to.
|
||||
*
|
||||
* @param buffer one or more chained buffer
|
||||
* @param offset Offset into the buffer
|
||||
* @return if total buffer length is bigger than offset then return
|
||||
* the offset byte pointer, otherwise return null
|
||||
*/
|
||||
extern uint8_t *gwbuf_byte_pointer(GWBUF* buffer, size_t offset);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -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 */
|
||||
|
Reference in New Issue
Block a user