Commit Graph

9883 Commits

Author SHA1 Message Date
57cfb709b8 MXS-1819 Also log info messages to syslog
If info messages are enabled, they will be logged to syslog
just like any other messages.
2018-04-24 10:18:19 +03:00
70f3f61ac4 Update version number in 2.1 2018-04-24 10:18:19 +03:00
7820158f93 Properly fix string truncation in snprint_timestamp
The length of the timestamp string had a practical meaning. The correct
fix was to always use the length passed as the parameter.
2018-04-23 18:21:58 +03:00
d67320e06a Fix more GCC 8 build failures
Fixed string truncation warnings by reducing max parameter lengths by one
where applicable. The binlogrouter filename lengths are slightly different
so using memcpy to work around the warnings is an adequate "solution"
until the root of the problem is solved.

Removed unnecessary CMake policy settings from qc_sqlite. Adding a
self-dependency on the source file of an external project has no effect
and only caused warnings to be logged.
2018-04-23 14:02:54 +03:00
8829e6d0c5 Reorder REST API configuration documentation
The REST API configuration documentation is now located after all other
global parameters in its own section. Added it to the ToC and put a link
to it into the REST API overview document.
2018-04-23 14:02:54 +03:00
421e64ceeb Take -Wall into use for tests
Take almost all warnings into use except `format-overflow` and
`unused-function`. format-overflow needs to be handled in a separate
commit.
2018-04-23 14:02:54 +03:00
0f0913fc99 Fix test build failures with GCC 8
GCC 8 enables -Werror=return-type by default which combined with -Werror
causes the build to fail.
2018-04-23 14:02:53 +03:00
2c6d27d600 MXS-1815: Use all available CPUs with threads=auto
The documentation stated that all CPUs would be used when threads=auto was
used. In reality the behavior was the same as was with 2.0 (number of CPUs
minus one).
2018-04-20 22:26:32 +03:00
3d325e29c4 MXS-1814: Log warning with log_debug in release mode
With release mode binaries, the log_debug option has no effect. Now a
warning is logged if the option is used.
2018-04-20 22:26:32 +03:00
739edcbe22 MXS-1639 Run user-given sql commands during promotion, demotion and rejoin
The sql queries are given in two text files, defined by options promotion_sql_file
and demotion_sql_file. The files must exist when monitor starts. The files are read
line by line, ignoring empty lines and lines starting with '#'. All other lines
are sent to the server being promoted, demoted or rejoined. Any error in opening
a file, reading it or executing the contents will cause the entire operation to
fail.

The filed defined in demotion_sql_file is also ran when rejoining a server. This
is to ensure a previously failed master is "demoted" properly when it joins the
cluster.
2018-04-19 17:01:36 +03:00
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
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
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
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
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
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
ff7f06cd66 Add 2.2.5 release notes
Added the release notes for MaxScale 2.2.5.
2018-04-17 09:34:12 +03:00
957f9865d6 Update MaxCtrl documentation
Updated MaxCtrl documentation.
2018-04-17 09:34:12 +03:00
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
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
890902e338 Add maxinfo SQL interface test
Added a test for the maxinfo SQL interface.
2018-04-17 09:34:11 +03:00
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
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
94af85b948 MXS-1787 Add test that exposes problem 2018-04-13 13:50:28 +03:00
3d09c836c5 init inst->sessions for maxinfo (#173)
* init inst->sessions for maxinfo

* misc fix
2018-04-13 12:58:02 +03:00
b060e3a289 MXS-1787: Add test case
Added a test case that reproduces the problem.
2018-04-12 20:36:46 +03:00
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
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
a663ea2e80 Sync slaves in mxs1071_maxrows
The first test could fail due to replication lag.
2018-04-12 10:29:26 +03:00
da03c73373 MXS-1776: Fix COM_STMT_EXECUTE flag extraction
The code extracted the statement id, not the flags.
2018-04-12 10:25:10 +03:00
fab8477c05 MXS-1776: Fix utility functions
The COM_STMT_FETCH command will create a response. This was a
readwritesplit-specific interpretation of the command and it was wrong.

Also record the currently executed command event for session commands.
2018-04-12 09:44:28 +03:00
ad5458f0e7 MXS-1776: Initialize RWBackend::m_command
The variable was not initialized which caused COM_CHANGE_USER to produce
unexpected behavior.
2018-04-12 09:43:38 +03:00
311adf817f MXS-1776: Handle recursive COM_STMT_EXECUTE commands
Readwritesplit would not handle multiple overlapping COM_STMT_EXECUTE
commands properly if they opened cursors. This was due to the fact that
the result would not be marked as complete and COM_STMT_FETCH commands
were executed as if they did not return results.

The correct implementation is to consider a COM_STMT_EXECUTE that opens a
cursor complete only when the first EOF packet is read (that is, when the
resultset header is read). This allows subsequent COM_STMT_FETCH commands
to be handled separately.

The separate COM_STMT_FETCH handling must count the number of packets that
are being fetched. This allows correct tracking of the state of a
COM_STMT_FETCH by checking that the number of packets is correct or the
second EOF/ERR packet is read.
2018-04-11 15:26:37 +03:00
252475cdc5 MXS-1776: Add test case
Added test case that reproduces the problem.
2018-04-11 15:13:20 +03:00
c0a3e6ba37 MXS-1773: Add test case
Added a test case that reproduces the problem and verifies that it is
fixed.
2018-04-11 09:45:13 +03:00
8e2208b957 Update limitations document
Removed old limitations from the document and cleaned up some of the text.
2018-04-11 09:25:29 +03:00
1eefb46e68 MXS-1773: Update internal state when LOAD DATA LOCAL INFILE fails
When a LOAD DATA LOCAL INFILE is actively rejected by the server, the
server sends an error to the client. This error was not detected and the
router was stuck in the special mode that handles LOAD DATA LOCAL INFILE.
2018-04-11 09:25:23 +03:00
e327282e82 Don't log warnings for valid SQL
The warnings are about what the parser expects, not something the end user
should know.
2018-04-10 21:39:46 +03:00
d28cf6b948 Merge branch '2.1' into 2.2 2018-04-10 15:27:20 +03:00
f94d1a9863 MXS-1767: Remove old debug assertion
The old assertion expected MaxScale to present the COMPRESS capability
which it doesn't support.
2018-04-10 15:24:57 +03:00
d22be5dd3e Fix build failure caused by merge from 2.1
The dcb->thread.id is dcb->poll.thread.id in 2.2.
2018-04-10 13:54:30 +03:00
fad4508fe2 Merge branch '2.1' into 2.2 2018-04-10 13:49:42 +03:00
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
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
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