Commit Graph

10092 Commits

Author SHA1 Message Date
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
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
d375733580 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-03 14:15:22 +03:00
36b10d3f05 MXS-1502: Log session command warning only once
The warning that tells the user that the session command history has been
exceeded is now only logged once. This is to prevent the message from
being repeatedly logged when the default value is not large enough.

Also fixed the session_limits test to use distinct session commands. This
way the session command history compaction is not in effect and the test
again tests the correct thing.
2018-04-03 13:32:10 +03:00
07821970ff MXS-1503: Remove false debug assertion
It is possible, and perfectly OK, for the new master to be in use at the
same time the old master is. This is the case if one of the slaves is
promoted as the master.
2018-04-03 13:32:10 +03:00
caa5fe89bb MXS-1503: Make sure backend is in use before using it
The get_backend_from_dcb function needs to check that the backend is in
use before comparing the pointer. This prevents stale pointers from being
used and is logically more sound than relying on raw DCB matches.
2018-04-03 13:32:10 +03:00
be0ab82283 MXS-1503: Fix master failure logging logic
The code that logs the master failure error was not working correctly
after the changes done for MXS-359 and MXS-1503. Updated the logic and
converted impossible cases into debug assertions.
2018-04-03 13:32:10 +03:00
34346f4de9 MXS-1503: Update tests with new expected results
The master reconnection change makes the second test faulty in
mxs359_error_on_write. After unblocking the master, the session will
reconnect to the master and the query will succeed.
2018-04-03 13:32:10 +03:00
319122e621 MXS-1502: Add have_session_commands helper function
The function conveys the meaning of the call better than using
session_command_count to check whether there are session commands to be
executed.
2018-04-03 13:32:10 +03:00
7d4f37d25b MXS-1503: Fix read-only mode regression
The master_failure_mode=error_on_write mode was broken due to a faulty
assumption that all successfully routed queries would produce a
target. This is not the case when a write in error_on_write mode is
received.
2018-04-03 13:32:09 +03:00
a15d36b2f0 MXS-1503: Take EqualPointees<T> into use
Take the template into use in readwritesplit.
2018-04-03 13:31:53 +03:00
98fb2cf5ed MXS-1503: Add EqualPointees<T> template
The templated provides an unary predicate for (shared) pointers that
allows containers containing pointers to objects to be searched, not by
pointer comparisons but by comparisons of the values that they point
to. This allows std::find_if to be used with shared pointers in a similar
manner that std::find is used with non-pointer objects.
2018-04-03 13:31:40 +03:00
14e399dd68 Move RWSplitSession into rwsplitsession.cc
Moved the class method definitions into the correct file.
2018-04-03 13:30:55 +03:00
d5643bc14d Create RWBackends from servers
Added a helper function that creates a list of servers to use. This should
remove some of the duplicate code in the routers.
2018-04-03 13:30:55 +03:00
6ef9e1fd9a Move RWBackend into a separate file
Moved the RWBackend class implementation into its own file. Made some of
the command type functions a part of the <maxscale/protocol/mysql.h>
header to make it reusable.
2018-04-03 13:30:55 +03:00
8206e1f46d Move RWBackend::reply_is_complete into rwsplitsession.cc
The function is now defined in the correct file. Removed the debug output
as it can be logged inside RWBackend::set_reply_state.
2018-04-03 13:30:54 +03:00
8222bdbc20 Move reply_is_complete into RWBackend
Moved the reply state checking inside the RWBackend class to make it
possibly reusable in other parts of MaxScale. Also removed a redundant
function.
2018-04-03 13:30:54 +03:00
3857912c61 MXS-1503: Abort connection when inside transaction
Before the transaction migration is implemented, the connection must be
closed if a transaction is open and the connection to the master is
lost. Doing this retains the same transactionality as a direct connection
to the server would.
2018-04-03 13:30:54 +03:00
ff496979f6 MXS-1503: Add test case
Added test case that checks that session commands are properly executed.
2018-04-03 13:30:54 +03:00
7f0745e552 MXS-1503: Queue command if executing a session command
When a non-connected target is chosed as the target server and the session
command history is not empty, the query needs to be placed into the query
queue and routed only after the session commands have been executed.
2018-04-03 13:30:53 +03:00