Commit Graph

10410 Commits

Author SHA1 Message Date
b2ec8c95de MXS-1765: Cork query queue until server handshake is read
The internal client must not drain the query queue if the server handshake
has not yet been read.
2018-04-10 13:45:47 +03:00
1e3ab1fc7c MXS-1765: Update current command for KILL processing
The current command needs to be updated before the queries are actually
routed. This allows the KILL command detection and processing to correctly
work.
2018-04-10 13:45:47 +03:00
434a71bc4d Replace std::to_string with std::stringstream
The GCC 4.4.7 implementation of std::to_string only has overloads for long
long int, long long unsigned int and long double. It's better to use
std::stringstream with this version of GCC to avoid having to write custom
code.
2018-04-09 22:35:40 +03:00
7f06c02f89 MXS-1703 Reduce use of MXS_MONITORED_SERVER in main loop
The base class should only be used with general monitor functions
and macros.
2018-04-09 14:57:16 +03:00
099219fa0f MXS-1767: Fix value assignment in ss_dassert
The value was updated for debug builds but not for release builds. This
caused debug builds to fail if special flags were requested.
2018-04-09 14:15:30 +03:00
cddf132d23 MXS-1762: Compare client IP when choosing a connection
When the connection pool is inspected, both the client username and IP
must match. This causes the pool to be partitioned by username and IP,
prevening unintentional sharing of connections between different users.
2018-04-09 13:21:18 +03:00
54121ed98b MXS-1703 Cleanup monitor interval waiting
The monitor now measures how long it should wait to get one interval.
2018-04-09 10:56:31 +03:00
8b642dbb5e MXS-1703 Rename typedefs in preparation for more changes
Also moved some code around.
2018-04-09 10:55:55 +03:00
71004a0ebc MXS-1703 Rearrange functions
Some functions were moved to class methods, others were moved to a different file.
All MariaDBMonitor fields are now private. Cleaned header a bit.
2018-04-09 10:54:34 +03:00
147355bbdb MXS-1744 Use gtid querying instead of MASTER_GTID_WAIT when waiting for catchup
MASTER_GTID_WAIT uses gtid_slave_pos when comparing to the target gtid. This creates
problems with multi-domain gtids. It's simpler to just query the server for its
gtids repeatedly. Also, the method is now in MariaDBServer.
2018-04-09 10:51:16 +03:00
174db469f3 MXS-1744 Rename and clean up gtid code, move to separate file
Renamed the two gtid-classes to better match MariaDB documentation. One
domain-server-sequence-combination is now a "Gtid", as these identify
a transaction. A "GtidList" contains a list of Gtid:s for handling multi-domain
server variables composed of multiple comma separated Gtid:s.

Removed unused methods and renamed some existing ones. Moved the Gtid-code
to its own file.
2018-04-06 10:23:02 +03:00
e43678bed9 MXS-1744 Take new Gtid-class into use
Also cleaned up mariadbserver a bit.
2018-04-06 10:16:29 +03:00
36bea39b63 MXS-1625 Remove need for RWS session from handle_multi_temp_and_load() 2018-04-05 15:05:04 +03:00
05a6aa2dea MXS-1625 Remove need for RWS session in helper functions 2018-04-05 14:04:30 +03:00
00ee271656 MXS-1625 Remove need for RWS session in log_transaction_status() 2018-04-05 13:54:37 +03:00
08987e3e85 MXS-1625 Remove need for RWS session in check_create_tmp_table 2018-04-05 13:42:39 +03:00
1133173a65 MXS-1625 Move tmp table management to QueryClassifier
Eventually only managed by QueryClassifier.
2018-04-05 13:38:55 +03:00
59d257579c MXS-1625 Move LOAD DATA sent statistics to QueryClassifier
Eventually the tracking will be internal to QueryClassifier.
2018-04-05 12:46:27 +03:00
340c132096 MXS-1625 Remove runtime checks for impossible errors
A readwritesplit session must have a client DCB and the DCB must
have data, otherwise the system is seriously broken. So no point
in checking for that and logging an error. Situations like that
might have been possible in the olden days when a session could
be manipulated by multiple threads at the same time.
2018-04-05 12:24:13 +03:00
8c0033ccb2 MXS-1625 Figure out multi statement state at startup
Whether or not multi statements are allowed is checked when
the QueryClassifier instance is created.
2018-04-05 10:16:23 +03:00
25386c4381 MXS-1625 Use PSManager of QueryClassifier 2018-04-05 10:16:23 +03:00
dbce77f9ee MXS-1625 Add PSManager to QueryClassifier
A copy of the PSManager of ReadWriteSplit.
2018-04-05 10:16:23 +03:00
befc34dea7 Fix RWSplitSession::route_stored_query
A member variable and local variable had the same names which caused the
member variable to not be used. With the change in the member variable,
this went unnoticed.
2018-04-04 20:54:46 +03:00
825d48fe05 MXS-1757: Fix build failure when libsnappy is installed
The Avro C API links against snappy if it is present on the system unless
SNAPPY_FOUND=N is defined. This is not exactly the cleanest way to disable
it but it is the only way to do it.
2018-04-04 19:43:47 +03:00
599f46ca7b Minor cleanup of different_size.cpp
Cleaned up the main testing function.
2018-04-04 19:43:47 +03:00
a2fcecd98f MXS-1743: Fix usage of both master and slave types
The use of `router_options=master,slave` was not working as expected. This
was mostly caused by the master bit checks using a bitwise AND instead of
comparing equality. In addition to this, the master would not be
considered a valid candidate if both slaves and masters were available.
2018-04-04 19:43:46 +03:00
4f8e1a99fc MXS-1743: Add test case
Added test case that reproduces the problem.
2018-04-04 19:43:46 +03:00
aaa8c92886 MXS-1744 Implement a Gtid-class which can store multi-domain gtid:s
The operations between Gtid:s are now more complicated so the class implements
them instead of the monitor. The Old Gtid-container has been renamed
GtidTriplet, and only stores the values for one triplet.
2018-04-04 15:53:42 +03:00
8596fea62a MXS-1625 Fix rebase breakage 2018-04-04 15:26:29 +03:00
c08120846c MXS-1625 large_query flag moved from RWS session to query classifier 2018-04-04 15:20:38 +03:00
bc22790e1b MXS-1625 Move tmp table state variable to mxs::QueryClassifier 2018-04-04 15:18:51 +03:00
8220c31664 MXS-1625 Move load data state to QueryClassifier
Still managed from the outside, but eventually will be managed
entirelly by QueryClassifier.
2018-04-04 15:16:46 +03:00
563fa2c840 MXS-1625 Add QueryClassifier instance to RWSplitSession
The readwritesplit session now has a mxs::QueryClassifier instance
as member.
2018-04-04 15:13: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
5e64695492 Move RWSplitSession methods into rwsplitsession.cc
Moved the RWSplitSession method implementations into the correct files.
2018-04-04 14:51:49 +03:00
87de1dc468 Only add MASTER_GTID_WAIT if it fits into one packet
The MASTER_GTID_WAIT "prefix" should only be added if it fits into one
packet. This is not a complete solution as it prevents queries larger than
16MB from benefiting from the consistent reads.
2018-04-04 14:47:29 +03:00
5a846063c1 Fix assignment of varible to itself
Caused by refactoring.
2018-04-04 14:33:00 +03:00
a85099676d Merge branch '2.2' into develop 2018-04-04 13:40:32 +03:00
063aef09f6 Merge branch '2.1' into 2.2 2018-04-04 13:39:55 +03:00
45cc816b0f Update release date 2018-04-04 13:39:04 +03:00
6749c029ae Update Release Notes and ChangeLog
Also, the list of release notes have been removed from the upgrading
document. The referral to the ChangeLog remains. That way, the list
of release notes need not be maintained in several places.
2018-04-04 13:38:43 +03:00
d07d9d59df Update release date 2018-04-04 13:30:15 +03:00
a762b76cbf MXS-1506: Remove redundant variables
Keeping track of the closed state of the session inside the router session
itself is not needed as the MaxScale core should already do that.

The skygw_chk_t variables are rather meaningless and are obsoleted by
Valgrind/ASAN.
2018-04-04 08:51:26 +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
ce500d782a MXS-1502: Improve max_sescmd_history warning message
The message now suggests what the user should do.
2018-04-03 16:28:09 +03:00
7d7cef7dcd Use router template in readwritesplit
Take the router template into use in readwritesplit.
2018-04-03 16:27:19 +03:00
90c2d575c5 Add missing test labels
Added missing labels to tests that didn't have them. Also added a few
clarifying comments.
2018-04-03 16:27:18 +03:00
221658299d MXS-1502: Derive EqualPointees from std::unary_function
This is done to make it clear that the class is intended to be used as an
unary function.
2018-04-03 16:27:18 +03:00
6a481ca21e MXS-1625 Use QueryClassifier in RouteInfo
Eventually the RWS session will contain a QueryClassifier
object as a member variable.
2018-04-03 16:02:18 +03:00
1556bac6e4 MXS-1625 Add QueryClassifier class
This is the first step in providing a QueryClassifier class
that is capable of performing context dependent query classification,
where the context is essentially the session state.
2018-04-03 16:02:18 +03:00