Commit Graph

33 Commits

Author SHA1 Message Date
d4674faa7d Convert maxscale/query_classifier.h to .hh
The header was not merged with queryclassifier.hh since the latter
does not include the former.
2019-01-15 18:18:39 +02:00
c0c9a9858d MXS-2197 Rename maxscale/log.h to maxscale/log.hh
In files either include maxscale/log.hh or remove include entirelly
as maxscale/ccdefs.hh includes it.
2018-12-10 12:58:17 +02:00
9f721f725e MXS-2205 Convert maxscale/protocol/mysql.h to .hh 2018-12-05 11:12:20 +02:00
ad12ff6d06 MXS-2196: Rename dcb.h to dcb.hh 2018-12-04 11:50:43 +02:00
756593a718 MXS-2205 Combine maxscale/router.h with maxscale/router.hh 2018-12-03 15:28:06 +02:00
97bb7e7e1a MXS-2205 Combine maxscale/modutil.h with maxscale/modutil.hh 2018-12-03 15:28:06 +02:00
9278da1f54 MXS-2067: Remove spinlock.h
Removed the spinlock.h header and replaced with plain pthread types and
functions.
2018-09-28 12:18:24 +03:00
2e069fa892 MXS-1632: Take mxb::atomic::add into use
The function now mostly replaces the use of atomic_add_ functions declared
in atomic.h.
2018-09-18 15:21:54 +03:00
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
cf0aeed516 MXS-2014 Rename log_manager.h to log.h
There's nothing resembling a manager anymore.
2018-08-17 10:59:37 +03:00
c01840ffb3 Remove unnecessary SConfig from readwritesplit
The configuration doesn't need to be contained in shared pointer as each
session holds its own version of it. This removes most of the overhead in
configuration reloading. The only thing that's left is any overhead added
by the use of thread-local storage.
2018-08-06 21:20:29 +03:00
bd4be3a97b Use shared configurations in readwritesplit
By using a shared pointer instead of a plain object, we can replace the
router configuration without it affecting existing sessions. This is a
change that is required to enable runtime reconfiguration of
readwritesplit.
2018-07-11 14:08:45 +03:00
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
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
c8d25f293f MXS-1506: Clean up various functions
Reduced variable scopes and removed unused code.
2018-04-10 15:31:51 +03:00
0771701d94 Rename readwritesplit member variables
Prefixed the variables with the `m_` prefix and changed some of them to be
more descriptive.
2018-04-04 14:59:56 +03:00
15f15be49d Move most readwritesplit functions into classes
Most of the funtionality is now a member function of either the RWSplit or
RWSplitSession class. This removes the need to pass the router and session
parameters to all functions.
2018-04-03 23:22:29 +03:00
0e968c2b28 MXS-1625 All RouteInfo functionality moved to routeinfo.cc
Provides a clearer separation between what deals with query
classification and what deals with query routing.

Functions have only been moved. No other cleanup has been
done.
2018-03-27 16:08:18 +03:00
e036582a98 Fix typo in readwritesplit log message
The `stmt` label was wrongly set to `pastmt`.
2018-03-08 14:03:46 +02:00
13c222488e RWS: Log packet length when logging transaction status 2018-02-25 20:56:02 +02:00
14a4008c84 MXS-1653: Remove false error message
Removed false error message about failed session commands. An error in
response to a session command is a perfectly valid result.

Also added the explicit commands that the master and slave return to the
warning that is logged when the results differ.
2018-02-07 16:07:17 +02:00
db61ec0d7e Add missing initialization in readwritesplit
A value was not always initialized for all queries when info level logging
was enabled.
2017-11-16 15:38:13 +02:00
ecb56ef540 Use references instead of copies of SRWBackend
As the DCB passed as the clientReply parameter is guaranteed to match one
of the DCBs in the RWBackends. By using a reference, the need to copy a
shared_ptr is removed (along with the atomic operation that it implies)
thus reducing the overhead in the clientReply and the functions it uses.
2017-10-12 12:29:43 +03:00
fbc1a7d44b Fix handling of multi-packet queries in readwritesplit
If a prepared statement sends large amounts of data, the target server
where the data is sent will be tracked. The tracked target was not reset
after a multi-packet query was completed and the target itself was used to
check whether the session was processing a multi-packet query.

Changed the check to use the boolean variable instead of the target and
added a reset of the tracked target after a multi-packet query was
completed.
2017-09-25 10:46:44 +03:00
45e0e8bb59 Introduce internal protocol command enum
The enums exposed by the connector are not intended to be used by the
users of the library. The fact that the protocol, and other, modules used
it was in violation of how the library is intended to be used.

Adding an internal mapping into MaxScale also removes some of the
dependencies that the core has on the connector.
2017-09-14 15:30:43 +03:00
cb57e10761 Develop merge
Develop merge
2017-06-29 15:34:22 +02:00
33a0f8be88 MXS-852: Add support for text protocol prepared statements
When a statement is being prepared, the type and name of the statement is
stored in the router session. If the name of a statement to be executed is
found in the map, the query type that stored in the map is used.
2017-06-22 10:40:18 +03:00
c7520a2156 Add name and uri helpers to Backend
Providing helper functions for the commonly used parts of the server makes
code easier to read. It also removes any possibility for formatting
problems by moving the URI and name string handling inside the Backend
class.
2017-06-22 10:40:18 +03:00
37b6cf250d Rename readwritesplit variables
Renamed variables to better represent the types of variables they
represent. Reordered some of the functions so that the functions don't
need to be declared before they are used.
2017-06-22 10:40:18 +03:00
0c45eb5d17 Take SessionCommand into use in readwritesplit
Readwritesplit now uses the SessionCommand class as a "master list" of
executed session commands. This allows the session commands to be easily
copied over to slaves that are taken into use after session commands have
already been executed.

Currently, the code doesn't execute the session command history when a
mid-session reconnection occurs. A method to cleanly copy the session
commands needs to be exposed by the Backend class.
2017-06-22 10:40:17 +03:00
dfc1d0a413 Always include debug members in objects
Having the structures be of the same size with and without debug mode is
beneficial when debugging release binaries.
2017-06-22 10:40:16 +03:00
bd7a26d830 Abstract the session default database
The default database can now be manipulated with a set of functions
exposed by the maxscale/protocol/mysql.h header. This removes the need to
handle the structures themselves in the modules and is a step towards
moving the dcb->data contents inside the session.
2017-06-22 10:40:16 +03:00
c77dcea807 Compile readwritesplit as C++
Compiling readwritesplit as C++ allows the use of C++ containers.
2017-06-22 10:40:15 +03:00