23 Commits

Author SHA1 Message Date
Esa Korhonen
c039821467 MXS-1883 Maintenance is now the only user-modifiable bit for a monitored server
The request to turn maintenance off/on is a separate flag, although the actual
status is still contained in the status bitfield.
2018-05-30 10:09:15 +03:00
Markus Mäkelä
3f4d6391b5
MXS-553: Add diagnostics_json to protocol API
The protocol now allows protocol modules to return JSON formatted
information about the protocol module internals. Currently this is only
implemented by the mariadbbackend module and it returns the current
connection ID on the backend server.
2018-05-22 17:46:25 +03:00
Markus Mäkelä
cdb43335a2
MXS-553: Update and document the protocol API
Removed unused and properly documented all entry points in the protocol
module API. As the removal of the `session` entry point is an backwards
incompatible change, the protocol API version was updated.
2018-05-22 17:46:25 +03:00
Johan Wikman
7e9062f20f Merge branch '2.2' into develop 2018-05-16 09:31:13 +03:00
Markus Mäkelä
00581e7f35
MXS-1826: Fix COM_CHANGE_USER regression
The re-authentication done in MaxScale caused multiple error packets to be
sent for the same COM_CHANGE_USER. In addition to this, the failure of
authentication did not terminate the client connection.

The change in behavior requires the test case to be changed as well.
2018-05-15 10:14:38 +03:00
Markus Mäkelä
d6c44aaf52
MXS-1804: Allow large session commands
Session commands that span multiple packets are now allowed and will
work. However, if one is executed the session command history is disabled
as no interface for appending to session commands exists.

The backend protocol modules now also correctly track the current
command. This was a pre-requisite for large session commands as they
needed to be gathered into a single buffer and to do this the current
command had to be accurate.

Updated tests to expect success instead of failure for large prepared
statements.
2018-05-03 09:46:47 +03:00
Johan Wikman
7876c3c70f MXS-1835 Turn all protocol modules into C++ 2018-05-02 09:54:37 +03:00
Markus Mäkelä
490d8c0963
Merge branch '2.2' into develop 2018-04-30 12:38:19 +03:00
Markus Mäkelä
452f2190ae
MXS-1826: Handle Authswitch packet for COM_CHANGE_USER
If the server responds with a COM_CHANGE_USER to the default
authentication plugin, the backend protocol will answer correctly.
2018-04-29 10:42:12 +03:00
Esa Korhonen
5d010ff712 Cleanup SERVER struct
Removed one unused field. Rearranged others, clarified comments.
2018-04-27 10:48:56 +03:00
Markus Mäkelä
e45759d35d
Skip scanning of OK packets if preparing statement
The OK packet that a COM_STMT_PREPARE returns is not a normal OK packet
and need to be skipped as the packet layout is different.
2018-03-20 13:42:25 +02:00
Markus Mäkelä
20c5ca1619
Make session state change tracking conditional
By making it conditional, we prevent the problems that arise when the
replication protocol is used in combination with the session state change
tracking. In addition to this, it prevents unnecessary work for routers
and filters that don't need it.
2018-03-20 13:42:24 +02:00
Markus Mäkelä
9f5d2244ea
Merge branch '2.2' into develop 2018-03-14 14:30:50 +02:00
Markus Mäkelä
d7c1d76065
Merge branch '2.1' into 2.2 2018-03-14 14:29:56 +02:00
Markus Mäkelä
2023ee4dc7
MXS-1713: Fix resultset collection code
The resultset collection was not detected early enough in the code which
caused partial results to be returned to the router.
2018-03-14 13:02:47 +02:00
Markus Mäkelä
771716e9db
Merge branch '2.2' into develop 2018-02-05 10:22:43 +02:00
Markus Mäkelä
9f0a691233 Always stop the session by closing the client DCB
By always starting the session shutdown process by stopping the client
DCB, the manipulation of the session state can be removed from the backend
protocol modules and replaced with a fake hangup event.

Delivering this event via the core allows the actual dcb_close call on the
client DCB to be done only when the client DCB is being handled by a
worker.
2018-02-02 12:28:07 +02:00
Markus Mäkelä
ebf0d6fc5f Close client DCB with a hangup in the backend protocol
Directly closing the client DCB in the backend protocol modules is not
correct anymore as the state of the session doesn't change when the client
DCB is closed. By propagating the shutdown of the session with a fake
hangup to the client DCB, the closing of the DCB is done only once.

Added debug assertions that make sure all DCBs are closed only
once. Removed redundant code in the backend protocol error handling code.
2018-02-02 12:28:07 +02:00
Dapeng Huang
81f303512e check protocol state to determine real ok packet 2018-01-22 14:52:12 +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
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
Johan Wikman
afaf890840 MXS-1596 Rename mysqlbackend to mariadbbackend 2018-01-05 10:01:50 +02:00