Commit Graph

11034 Commits

Author SHA1 Message Date
960d08a36a Code cleanup
Removed unused code.
2018-06-29 10:54:34 +03:00
0afcd4b468 Fix test-program failures
Due to recent changes, mxs::MessageQueue::init() must be called
explicitly, if a monitor is created.
2018-06-29 10:43:49 +03:00
9525d3507b Run manual commands without stopping the monitor
The command is saved in a function object which is read by the monitor
thread. This way, manual and automatic cluster modification commands are
ran in the same step of a monitor cycle.

This update required several modifications in related code.
2018-06-28 16:56:41 +03:00
6bf10904d7 MXS-1845 Only rebuild topology when required
The monitor now detects when a server has changed such that a replication
graph rebuild is needed and only then rebuilds the graph and detects
cycles and master.

Also, some old code is no longer called in the monitor cycle. It will be
removed in later commits. Refactored some of the related functions.
2018-06-28 16:56:41 +03:00
76fb7a695e Update 2.2 version number 2018-06-28 10:41:24 +03:00
dc4a555c70 Merge branch '2.2' into develop 2018-06-28 10:34:41 +03:00
c33837c906 Update release date of 2.2.10 2018-06-28 10:25:54 +03:00
a6182d48bf MXS-1643: Only test existence of extra events mxs1643_extra_events
Don't test failover functionality when it is not needed. The bug is only
about the extra events that appear when a master is demoted and a slave is
promoted.
2018-06-27 10:49:32 +03:00
b5fdcf66ab Make test_event.cc more resilient
- Work on both Debian and RedHat systems.
- Ignore test if authentication log cannot be found or cannot be read.
2018-06-27 09:30:31 +03:00
b7fdaf0340 Use wait_for_monitor in mxs1643_extra_events
Replace hard-coded sleeps in mxs1643_extra_events with
Maxscales::wait_for_monitor.
2018-06-27 08:49:55 +03:00
f49c31625d Use derived version of write for session commands
Prepared statements via readwritesplit need to have their IDs mapped from
the internal representation to the backend specific one. The RWBackend
class does this in its write method but the fix in commit
e561c3995c7396cf3749ccdf6a3357d7dd32c856 caused this to be bypassed and
the base version was always used.
2018-06-27 08:49:54 +03:00
f97f422379 Don't use closed backends
Only use backends that are still in use. The COM_STMT_EXECUTE and
COM_STMT_FETCH relationship caused unused backends to be used.
2018-06-27 08:49:21 +03:00
d5bdc3febd Fix formatting for dump_last_statements
A backtick was missing.
2018-06-27 08:49:20 +03:00
4d7121593e MXS-421 Update change log and release notes 2018-06-26 11:54:00 +03:00
1eddb29d91 MXS-1915 Move Monitors on top of mxs::Worker
Monitors are now workers, so the path for making all interaction
between MaxScale proper and the monitors message based is now
open.
2018-06-26 09:19:46 +03:00
8ea7d8898a MXS-1915 Remove id from mxs::Worker
The id has now been moved from mxs::Worker to mxs::RoutingWorker
and the implications are felt in many places.

The primary need for the id was to be able to access worker specfic
data, maintained outside of a routing worker, when given a worker
(the id is used to index into an array). Slightly related to that
was the need to be able to iterate over all workers. That obviously
implies some kind of collection.

That causes all sorts of issues if there is a need for being able
to create and destroy a worker at runtime. With the id removed from
mxs::Worker all those issues are gone, and its perfectly ok to create
and destory mxs::Workers as needed.

Further, while there is a need to broadcast a particular message to
all _routing_ workers, it hardly makes sense to broadcast a particular
message too _all_ workers. Consequently, only routing workers are kept
in a collection and all static member functions dealing with all
workers (e.g. broadcast) have now been moved to mxs::RoutingWorker.

Now, instead of passing the id around we instead deal directly
with the worker pointer. Later the data in all those external arrays
will be moved into mxs::[Worker|RoutingWorker] so that worker related
data is maintained in exactly one place.
2018-06-26 09:19:46 +03:00
86b5238aaf MXS-1915 Replace worker id with worker pointer
To get rid of the need that a Worker must have an id, we store
in the MXS_POLL_DATA structure a pointer to the owning worker
instead of the id of the owning worker. This also allows some
further cleanup as the need for switching back and forth between
the id and the worker disappears.

The id will be moved from Worker to RoutingWorker as there
currently is a fair amount of code that assumes that the id of
routing workers start from 0.
2018-06-26 09:19:46 +03:00
241c9b645d MXS-1915 Remove unused functions 2018-06-26 09:19:46 +03:00
5cf6a9ed22 MXS-1915 Allow Worker to be used stand-alone
It's no longer necessary to inherit from Worker in order to use
it, but it can now be used in a stand-alone fashion. This fits
the MonitorInstance use-case better.
2018-06-26 09:19:46 +03:00
063e9b9a36 MXS-1939 Remove leak in cache test program 2018-06-25 12:12:20 +03:00
f7ca8d1494 MXS-1939 Ensure no leaks when there is an array of rules
In case an array of cache rules is provided, we will only store
references to the objects in the array. Consequently, the counts of
the borrewed references to the objects must be increased, and the
reference count of the array itself decreased.
2018-06-25 12:08:44 +03:00
b7451c13bf MXS-1939 Fix leaks in mock-class
The mock-class used in the cache testing leaked memory.
2018-06-25 11:27:53 +03:00
fd202c9339 Look for more ASAN llibrary versions
On Ubuntu libasan.so.1 and libasan.so.2 are present.
2018-06-25 11:01:08 +03:00
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
b8e0c31872 Merge branch '2.2' into develop 2018-06-25 09:37:18 +03:00
82af399fb1 Add 2.2.10 release notes
And update the change log.
2018-06-25 09:19:30 +03:00
6183fab79b MXS-1938: Log query for inconsistent replies
If a session command produces a different result on the slave than it did
on the master, a warning is logged. This warning now also logs the query
that was being executed to make investigation of the problem easier.
2018-06-25 08:44:13 +03:00
f308dd281a MXS-1849 Combine table and database mapping
Previously schemarouter only mapped databases to the servers
they were resided on. Now all the tables are also mapped to allow the
router to route queries to the right server based on the tables used in
that query.
2018-06-24 22:26:36 +03:00
b38cac4939 MXS-1849 Add functions for mapping tables to servers 2018-06-24 22:26:36 +03:00
249e66756f Fix run_session_hang.sh
The script it called used the wrong variable name.
2018-06-22 13:59:57 +03:00
2c5dacf9ae Clean up mxs314
Removed excessive output, used stack allocated objects, simplified
assertions.
2018-06-22 13:59:57 +03:00
3d8f946e19 Take dump_stacktrace into use
MaxScale and tests now both use the same code to dump stacktraces.
2018-06-22 13:59:57 +03:00
c32e6a7c3f Add stacktrace generation to maxbase
The stacktrace generation is now a part of the maxbase library. The code
is the same code that was previously defined in gateway.cc as a part of
MaxScale.
2018-06-22 13:59:57 +03:00
be853a448c Link tests against maxutils
The tests now link against the maxutils libraries. Currently, the maxutils
libraries consist of only the maxbase library.
2018-06-22 13:59:57 +03:00
7254a7c525 Make maxutils a standalone library
The only way to cleanly separate the maxutils library from the MaxScale
CMake project is to make it a standalone CMake project. With the help of
ExternalProject, it should be relatively easy to use.
2018-06-22 13:59:57 +03:00
b96228f95c Merge branch '2.2' into develop 2018-06-22 10:44:39 +03:00
c70cc61132 Remove unused code in mysqlmon_failover_rejoin_old_slave
The sleep function is no longer used.
2018-06-22 10:37:11 +03:00
e561c3995c Use correct write in Backend::execute_session_command
Backend::execute_session_command would use the overridden write method
instead of the Backend::write method that it intended to use. This caused
session commands that did not expect a response to be in a state that
expected a result.

Also fixed RWBackend::write pass the response_type value to
Backend::write.
2018-06-22 10:37:11 +03:00
bb67c4fb8f Remove unused test
The test was not used.
2018-06-22 10:37:11 +03:00
9f2a4c4368 Request GTID in mysqlmon_failover_rejoin_old_slave
The test won't otherwise work as the failover is not done without it.
2018-06-22 10:37:11 +03:00
998798c90c Make test_event more reliable
Look for the expected message several times, with short sleeps in
between. That way we will not sleep more than necessary, yet will
not immediately give up either.
2018-06-21 15:42:50 +03:00
c49b6ada7d MXS-1932: Make it clear what is being tested
The test was not very clear about what it does. Added comments to clarify
what is done and why. Also fixed a typo.
2018-06-21 15:17:10 +03:00
d22a62c0ff Use sleeps and waits with mxs1719
Going the belt-and-suspenders way of both sleeping and waiting for the
moitor should make sure MaxScale has at least some time to start up, query
the servers and do a single iteration of monitoring.
2018-06-21 15:12:12 +03:00
d9cc65cca7 Enable mxs1824_double_cursor in 2.2
The test apparently started working when 10.3 was set as the default
backend.
2018-06-21 15:12:12 +03:00
8a526bf84f MXS-1926: Add test case
Added a test case that reproduces the problem and verifies that it is
solved.
2018-06-21 15:12:12 +03:00
75ddfe4c14 Merge branch '2.2' into develop 2018-06-21 14:02:00 +03:00
0f61c4b6a4 MXS-872: Also check that mysql.user.default_role exists
The column is used so it should be checked that it exists. Also
altered the SQL to use statements that do not return resultsets.
2018-06-21 14:00:29 +03:00
254084fc5e MXS-1935 Accept "PREPARE name FROM @var" 2018-06-21 12:51:47 +03:00
457d74f6b4 MXS-1935 Add test that exposes problem
"PREPARE a FROM @var" is not classified.
2018-06-21 12:51:47 +03:00
45bda0f72e MXS-1936 Make qc_mysqlembedded compatible with qc_sqlite
qc_mysqlembedded must also be updated to handle the new type
QUERY_TYPE_DEALLOC_PREPARE. Some adjustements were also needed
elsewhere.
2018-06-21 12:51:47 +03:00