10237 Commits

Author SHA1 Message Date
Markus Mäkelä
a61c9cfdfa
Make assignment operator unambiguous
Copying a std::deque<mxs::Buffer> would cause a compilation failure due to
ambiguity between the copy-assignment and move-assignment
operators. Explicitly constructing a temporary object retains the strong
exception guarantee but prevents the ambiguity.
2018-04-20 10:24:00 +03:00
Markus Mäkelä
43a99886e9
Fix SESSION_TRACK_SCHEMA tracking
The SESSION_TRACK_SCHEMA tracking capability handling assumed an encoding
integer in the data. This value does not exist for the data returned by
schema change or session state tracking.
2018-04-20 10:24:00 +03:00
Johan Wikman
4d4ab83e99 MXS-754 Fix unit test failures caused by RoutingWorker 2018-04-19 10:51:28 +03:00
Esa Korhonen
02c57c98e4 MXS-1703 Move more methods to MariaDBServer
These methods only modify or update a single server.
2018-04-18 10:27:16 +03:00
Esa Korhonen
50bc43e4bf MXS-1703 Move server-specific diagnostic printing to MariaDBServer 2018-04-18 10:27:16 +03:00
Esa Korhonen
91e6874ac0 MXS-1703 Failover launch code cleanup
Removed one field from MXS_MONITOR, as it was only used by mariadbmon and is
unnecessary (the case it handled was impossible).
2018-04-18 10:27:16 +03:00
Markus Mäkelä
99a9dd1006
Merge branch '2.2' into develop 2018-04-18 09:36:17 +03:00
Markus Mäkelä
474736584b
Fix test_poll failure
With the changes to the DCB handling, the service pointer of a client DCB
must always be assigned.

Also removed the unnecessary parentheses around the comparison.
2018-04-18 08:10:42 +03:00
Markus Mäkelä
a2b78d40cf
Merge branch '2.2' into develop 2018-04-18 08:00:48 +03:00
Markus Mäkelä
1cc99d2fda
Fix core build failure with GCC 8
GCC 8 warns when a polymorphic type is caught by value.
2018-04-17 22:17:34 +03:00
Markus Mäkelä
ad15f4d4be
Fix binlogrouter build failures with GCC 8
GCC 8 appears to have improved the snprintf truncation detection which
revealed problems in the binlogrouter.
2018-04-17 21:55:47 +03:00
Markus Mäkelä
3a1c2119fb
MXS-1804: Fix hanging of large session commands
Large session commands weren't properly handled which caused the router to
think that the trailing end of a multi-packet query was actually a new
query.

This cannot be confidently solved in 2.2 which is why the router session
is now closed the moment a large session command is noticed.
2018-04-17 15:04:12 +03:00
Markus Mäkelä
232f807ef3
MXS-1808: Only store SQL statements for retrying
Only commands that can contain an SQL statements should be stored for
retrying (COM_QUERY and COM_EXECUTE). Other commands are either session
commands or do not work with query retrying.
2018-04-17 11:25:56 +03:00
Esa Korhonen
c928cf6331 MXS-1703 Fix crash when saving journal without a master server 2018-04-17 10:40:59 +03:00
Johan Wikman
12bd34c8d3 MXS-1625 Remove the PS manager from RWS
Not used as it now is in QueryClassifier
2018-04-17 10:09:37 +03:00
Johan Wikman
7d97bf76ea MXS-1625 Remove duplicate function
Correct test in remaining function.
2018-04-17 10:09:37 +03:00
Johan Wikman
77a258de86 MXS-1625 Unnecessary function removed 2018-04-17 10:09:37 +03:00
Markus Mäkelä
fff727e0c2
MXS-1782: Take getCollectionAsResource into use
Each `show` type command that takes a resource name now also has a version
that prints all resources of that type.

Added test cases for newly added commands.
2018-04-17 09:43:57 +03:00
Markus Mäkelä
87ce1f6dab
MXS-1782: Separate resource fetching and processing
The requesting of a resource and the processing was integrated into one
function. Moving the processing part into a separate function allows easy
processing of resource collections.

This refactoring made the creation of the getCollectionAsResource function
possible. It enables `show` type commands for resouce collections
(servers, services etc.).
2018-04-17 09:43:57 +03:00
Markus Mäkelä
32fdc3d454
MXS-1782: Add listener state to REST API
The state of each individual listener is now displayed in the REST
API. Created common functions for printing the listener state and took
them into use. Added the new state into MaxCtrl output.
2018-04-17 09:43:57 +03:00
Markus Mäkelä
f8a91fb272
MXS-1782: Add show threads to MaxCtrl
Provides same output in MaxCtrl that is in MaxAdmin.
2018-04-17 09:43:56 +03:00
Markus Mäkelä
c90cfc0bee
MXS-1782: Add missing thread information
The load averages and open/total file descriptor counts were missing from
the REST API.
2018-04-17 09:43:56 +03:00
Markus Mäkelä
5cb4c9dd97
Merge branch '2.2' into develop 2018-04-17 09:36:40 +03:00
Markus Mäkelä
dac1b252ff
MXS-1807: Make module command domains case-insensitive
As the module names are case-insensitive in 2.2, so should be the domain
names of module commands.
2018-04-17 09:34:12 +03:00
Markus Mäkelä
0adb4b6ffa
Add basic docker-compose setup
The setup contains a three node master-slave cluster with both
readwritesplit and readconnroute.

Removed the duplication of the configuration files in the README and
provided links instead.
2018-04-17 09:34:12 +03:00
Markus Mäkelä
ff7f06cd66
Add 2.2.5 release notes
Added the release notes for MaxScale 2.2.5.
2018-04-17 09:34:12 +03:00
Markus Mäkelä
957f9865d6
Update MaxCtrl documentation
Updated MaxCtrl documentation.
2018-04-17 09:34:12 +03:00
Markus Mäkelä
5855b307bd
Add raw REST API calls to MaxCtrl
Being able to perform raw REST API calls that leverage the value
extraction capabilities of Node.js gives more control to the end user. It
also doubles as a handy tool for creating scripts that only require one
particular value from the REST API.
2018-04-17 09:34:11 +03:00
Markus Mäkelä
41626202ed
MXS-1803: Simplify docker image
The docker image now simply installs the latest MaxScale version instead
of building it. This significantly reduces the amount of maintenance that
the image requires.

Updated the configurations to allow runtime definition of servers and
updated README.md to reflect the changes in the files. Pointed links to
2.2 instead of develop. Removed text from the readme that was not strictly
related to running the MaxScale image.
2018-04-17 09:34:11 +03:00
Markus Mäkelä
890902e338
Add maxinfo SQL interface test
Added a test for the maxinfo SQL interface.
2018-04-17 09:34:11 +03:00
Johan Wikman
b36f6faa7e MXS-1754 Reintroduce maxscale::Worker
Worker is now the base class of all workers. It has a message
queue and can be run in a thread of its own, or in the calling
thread. Worker can not be used as such, but a concrete worker
class must be derived from it. Currently there is only one
concrete class RoutingWorker.

There is some overlapping in functionality between Worker and
RoutingWorker, as there is e.g. a need for broadcasting a
message to all routing workers, but not to other workers.

Currently other workers can not be created as the array for
holding the pointers to the workers is exactly as large as
there will be RoutingWorkers. That will be changed so that
the maximum number of threads is hardwired to some ridiculous
value such as 128. That's the first step in the path towards
a situation where the number of worker threads can be changed
at runtime.
2018-04-16 14:53:08 +03:00
Johan Wikman
230876cd69 MXS-1754 Rename mxs::Worker to mxs::RoutingWorker
A new class mxs::Worker will be introduced and mxs::RoutingWorker
will be inherited from that. mxs::Worker will basically only be a
thread with a message-loop.

Once available, all current non-worker threads (but the one
implicitly created by microhttpd) can be creating by inheriting
from that; in practice that means the housekeeping thread, all
monitor threads and possibly the logging thread.

The benefit of this arrangement is that there then will be a general
mechanism for cross thread communication without having to use any
shared data structures.
2018-04-16 14:53:08 +03:00
Johan Wikman
fa3143cedf Merge branch '2.2' into develop 2018-04-16 14:46:19 +03:00
Esa Korhonen
9b7ec7ee58 MXS-1703 Add missing manual rejoin error messages
Calling rejoin with a server which is already replicating now gives a proper error
message.
2018-04-16 13:52:23 +03:00
Esa Korhonen
ba23aa9ce5 MXS-1703 Update monitor documentation
Clarify some parts and add note of switchover master autoselection. Also update
release notes.
2018-04-16 13:48:56 +03:00
Esa Korhonen
c43f64c87e MXS-1703 Cleanup more methods
Most monitor functions now work with the monitor's own server class.
2018-04-16 13:48:56 +03:00
Johan Wikman
7e29725050 MXS-1805 Force all maxadmin connections to main thread
If maxadmin connections are handled by different workers, then
there may be a deadlock if some maxadmin command requires
communication with all workers.

Namely, in that case a message will be sent to all other workers
but the current one, but that message will not be handled if that
other worker at that point sits in the debugcmd_lock spinlock
in debugcmd.c:execute_cmd().

We can prevent that deadlock from happening simply by ensuring
that all maxadmin connections are handled by one thread.
2018-04-16 13:25:33 +03:00
Markus Mäkelä
ec33fcf87d
Merge branch '2.2' into develop 2018-04-13 14:53:00 +03:00
Johan Wikman
3d8d2beaaa MXS-1787 Provide alias map when parsing an expression list
A statement like "CALL p1((SELECT f1()), ?);" needs an collection
for storing aliases when being parsed.
2018-04-13 13:50:28 +03:00
Johan Wikman
94af85b948 MXS-1787 Add test that exposes problem 2018-04-13 13:50:28 +03:00
Esa Korhonen
3c8d3feff9 MXS-1703 Run astyle, rewrite comments & reorder fields
No functional changes.
2018-04-13 13:33:13 +03:00
Esa Korhonen
4d6239635e MXS-1703 Add and use convenience functions for common macros/fields
Also add debug assert to MariaDBServer ctor.
2018-04-13 13:31:12 +03:00
dapeng huang
3d09c836c5 init inst->sessions for maxinfo (#173)
* init inst->sessions for maxinfo

* misc fix
2018-04-13 12:58:02 +03:00
Esa Korhonen
f7cc2aed5a MXS-1703 Remove MariaDBServer value array type
Having two types of arrays was more trouble than worth. Clearer to just
use the array of pointers. Renamed ServerRefArray to ServerArray.
2018-04-13 10:08:57 +03:00
Esa Korhonen
9fe57bfb9b MXS-1703 Change type of m_master to MariaDBServer 2018-04-13 10:08:57 +03:00
Markus Mäkelä
e3b11d866f
Use explicit types with get_row
Auto types aren't very neat as return values because they move the burden
of knowledge to the reader. Using an explicit, and somewhat
self-explanatory, type makes it easier to assess the code without knowing
the implementation of the type.
2018-04-13 08:48:21 +03:00
Markus Mäkelä
b060e3a289
MXS-1787: Add test case
Added a test case that reproduces the problem.
2018-04-12 20:36:46 +03:00
Markus Mäkelä
802b16f709
MXS-1786: Fix hang on COM_STATISTICS
The commands needs to be handled separately from the rest of the result
types.

Added a test case that reproduces the problem and verifies that the change
in code fixes it.
2018-04-12 20:00:00 +03:00
Markus Mäkelä
1a293c0093
MXS-1785: Don't assume empty packet is for LDLI
When a LOAD DATA LOCAL INFILE finishes, the client sends an empty
packet. The second case when the client sends an empty packet when the
previous packet was exactly 0xffffff bytes long. These two packets were
confused which caused the internal state to temporarily flip from inactive
to ending and back to inactive.

The aforementioned flip-flopping didn't have any practical differences but
it was caught by a debug assertion.
2018-04-12 19:36:34 +03:00
Esa Korhonen
b6e421e13b MXS-1703 Use a common header for all mariadbmon files
The mariadb_common.hh file is now a header with only common definitions
such as module name. The QueryResult-class was moved to MariaDBServer.
2018-04-12 13:06:36 +03:00