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

@ -14,6 +14,7 @@
#include "readwritesplit.hh"
#include "rwsplit_ps.hh"
#include <string>
#include <maxscale/modutil.h>
@ -27,6 +28,13 @@ enum reply_state_t
REPLY_STATE_RSET_ROWS /**< Resultset response, waiting for rows */
};
typedef enum
{
EXPECTING_NOTHING = 0,
EXPECTING_WAIT_GTID_RESULT,
EXPECTING_REAL_RESULT
} wait_gtid_state_t;
/** Reply state change debug logging */
#define LOG_RS(a, b) MXS_DEBUG("%s %s -> %s", (a)->uri(), \
rstostr((a)->get_reply_state()), rstostr(b));
@ -138,6 +146,9 @@ public:
PSManager ps_manager; /**< Prepared statement manager*/
ClientHandleMap ps_handles; /**< Client PS handle to internal ID mapping */
ExecMap exec_map; /**< Map of COM_STMT_EXECUTE statement IDs to Backends */
std::string gtid_pos; /**< Gtid position for causal read */
wait_gtid_state_t wait_gtid_state; /**< Determine boundray of wait gtid result and client query result */
uint32_t next_seq; /**< Next packet'ssequence number */
skygw_chk_t rses_chk_tail;
private: