23 Commits

Author SHA1 Message Date
Markus Mäkelä
d6b8147119
Merge branch '2.2' into develop 2018-03-06 17:02:03 +02:00
Markus Mäkelä
d5226fa7d1
MXS-1698: Fix double SSL connection
When backend SSL connections were created, the connection creation was
done twice. This was due to the lacking detection of an already
established SSL connection.
2018-03-06 13:35:15 +02:00
dapeng
8a0c8e63f2 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
2018-02-05 09:09:18 +02:00
Dapeng Huang
a035c91fa6 add doc for session_track_trx_state and refactor little 2018-01-29 10:16:03 +02:00
Markus Mäkelä
7b04d17ce3 Use correct function for consuming LEncStrings
Length-encoded strings should be consumed with the correct
functions. Doing pointer arithmetic with the same pointer as a parameter
appears to fail only on CentOS 6 whereas on newer systems it performs as
expected.
2018-01-24 20:30:02 +02:00
Markus Mäkelä
dfbecc41e2 Format protocol modules
Formatted the MariaDB protocol modules with Astyle.
2018-01-24 11:20:11 +02:00
Dapeng Huang
73e5fd52fa misc fix and remove all tail spaces 2018-01-22 22:02:22 +08:00
Dapeng Huang
1729d73b19 revert deprecate eof 2018-01-22 20:28:50 +08:00
Dapeng Huang
f41f3a1544 support deprecated eof and fix eof count 2018-01-22 20:20:52 +08:00
Dapeng Huang
81f303512e check protocol state to determine real ok packet 2018-01-22 14:52:12 +08:00
Dapeng Huang
8ce7683a0a fix parse session track info out of packet boundary 2018-01-21 18:27:00 +08:00
Dapeng Huang
f7e08fdb47 add doc, more detail about trx state 2018-01-16 15:14:29 +08:00
Dapeng Huang
f1aa1d7d9f fix code style 2018-01-16 14:56:51 +08:00
Dapeng Huang
a52e1ac8d7 add session tracker:SESSION_TRACK_TRANSACTION_CHARACTERISTICS and fix wrong state mapping 2018-01-16 13:56:00 +08:00
Dapeng Huang
6d3c60eb28 remove noneed protocol and the comparison corrent 2018-01-15 22:07:23 +08:00
Dapeng Huang
d234b13027 refactor, check every packet before parser ok packet, move config to service, fix code style, ... 2018-01-15 20:25:44 +08:00
Dapeng Huang
e1aeac8b07 get session transation state from backend via session track mechanism 2018-01-14 12:23:38 +08:00
Markus Mäkelä
ca0b9de421 Add missing initialization of MySQLProtocol::collect_result
The variable was not initialized.
2017-10-12 12:29:43 +03:00
Johan Wikman
87c01428be Make mxs_mysql_get_command inline 2017-10-12 12:29:43 +03:00
Markus Mäkelä
a6eeed98fe Fix handling of collected results
The result collection did not reset properly when a non-resultset was
returned for a request. As collected result need to be distinguishable
from single packet responses, a new buffer type was added.

The new buffer type is used by readwritesplit which uses result collection
for preparation of prepared statements.

Moved the current command tracking to the RWBackend class as the command
tracked by the protocol is can change before a response to the executed
command is received.

Removed a false debug assertion in the mxs_mysql_extract_ps_response
function that was triggered when a very large prepared statement response
was processed in multiple parts.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
96d160f897 MXS-1452: Add support for KILL USER <name>
Added support for killing queries by username. This will kill all
connections from that particular user on all servers.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
49b179bf69 Add HARD/SOFT to executed KILL commands
The HARD and SOFT keywords are parsed and added to the executed KILL
commands.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
4dd6842447 Send KILL commands to backends
KILL commands are now sent to the backends in an asynchronous manner. As
the LocalClient class is used to connect to the servers, this will cause
an extra connection to be created on top of the original connections
created by the session.

If the user does not have the permissions to execute the KILL, the error
message is currently lost. This could be solved by adding a "result
handler" into the LocalClient class which is called with the result.
2017-10-03 14:47:16 +03:00