Commit Graph

3711 Commits

Author SHA1 Message Date
146b940245 Dump statements on fatal signal
This should make it easier to figure out what is going on at the time of
the crash if statement collection is enabled.
2019-07-19 12:03:36 +03:00
c878d796be Merge branch '2.2' into 2.3 2019-07-16 12:59:03 +03:00
bc2f7f4040 MXS-2597: Log libmicrohttpd errors on startup
By enabling the debug messages only at startup, we'll get log messages for
any daemon startup failures and we exlude the verbose parsing errors that
malformed requests cause.
2019-07-16 10:03:27 +03:00
797069df52 Fix npm audit warnings
Updated lodash to a newer version.
2019-07-16 09:34:15 +03:00
8c84a2b2a4 Fix error detection in service creation
If a server that did not exist was added to the service, the error would
not cause a startup failure.
2019-07-11 09:39:06 +03:00
0394c9c525 MXS-2449: Fix maxinfo monitor status output
The status use an AND operation when it should do an equality comparison.
2019-07-10 12:38:10 +03:00
9de06a52b0 Allow infinite refreshes of users
The hard limit of 10 seconds is too strict when taking into account the
fact that infinite refreshes was possible before the bug was fixed. This
also makes testing a lot easier where rapid reloads are necessary.
2019-07-10 11:06:52 +03:00
8a176d64aa MXS-2490: Add direct execution support
Certain MariaDB connectors will use the direct execution for batching
COM_STMT_PREPARE and COM_STMT_EXECUTE execution without waiting for the
COM_STMT_PREPARE to complete. In these cases the COM_STMT_EXECUTE (and
other COM_STMT commands as well) will use the special ID 0xffffffff. When
this is detected, it should be substituted with the ID of the latest
statement that was prepared.
2019-07-09 14:59:52 +03:00
1b69e659db Assert DCB ownership in dcb_drain_writeq
This will cause EPOLLOUT events for maxscaled to trigger the assert
immediately if the buffer was placed into the queue by another worker.
2019-07-08 12:37:35 +03:00
e658dca4fe Allow rapid reloading of users on startup
This fixes the test failures that stem from users being created right
after maxscale has started. This also should make startups a bit smoother
now that the default value of users_refresh_time has been fixed.
2019-07-08 11:32:16 +03:00
2238faa913 Make response time lock server-specific
There's no global data being modified inside the method call so a instance
level lock is sufficient.
2019-07-07 21:20:28 +03:00
be8f4fe055 MXS-1901: Route related PS commands to same server
All COM_STMT_SEND_LONG_DATA commands and the COM_STMT_EXECUTE that follows
it must be sent to the same server. This implicitly works for masters but
with multiple slave servers the data could be sent to the wrong server.

By using the code added for MXS-2521, this problem can now be easily
solved by checking what the previous command was.
2019-07-04 09:37:09 +03:00
f36b6492ab Update current DCB for hangup events
When fake hangup events are delivered via DCBs, the current DCB would not
be updated. This would cause error messages without a session ID which
makes failure analysis harder.
2019-07-04 08:21:16 +03:00
2d77a361f2 MXS-2586: Fix users_refresh_time
The default value was not assigned on startup.
2019-07-03 11:15:21 +03:00
418a1f5210 MXS-2584: Assert that workers are initialized
The initialization must always be done before a call to RoutingWorker::get
is done.
2019-07-01 16:37:55 +03:00
b2019ea18e Correctly reset PS continuation state
The state was modified only by PS commands.
2019-07-01 10:33:18 +03:00
42c37585f4 Throttle query retry attempts
It was possible that a one-second outage that caused immediate rejection
of network connections would cause all of the query retry attempts to fail
within a very short period of time. By preventing rapid reconnections,
query_retries is more effective as an error filtering mechanism.
2019-06-28 09:27:20 +03:00
5eba688c1b MXS-2521: Detect COM_STMT_EXECUTE without metadata
If a COM_STMT_EXECUTE has no metadata in it and it has more than one
parameter, it must be routed to the same backend where the previous
COM_STMT_EXECUTE with the same ID was routed to. This prevents MDEV-19811
that is triggered by MaxScale routing the queries to different backends.
2019-06-27 08:29:30 +03:00
d15582d26d Allow posting to stopped workers
Due to there being no distinction between a temporarily stopped worker and
a permanently stopped one, we must allow posting of messages to stopped
workers.
2019-06-25 17:32:24 +03:00
a51e094cd5 Merge branch '2.2' into 2.3 2019-06-24 15:07:18 +03:00
7fb268f1a7 MXS-2575: Fix REST-API error propagation
The errors are now correctly sent even with requests that upload data.
2019-06-24 14:37:40 +03:00
1cb13582ff Fix worker state debug assertion
Stopped workers will receive messages.
2019-06-24 11:03:50 +03:00
805be70a78 Add more information to rwsplit info messages
The statement ID for all binary protocol statements and the error given to
handleError are now logged.
2019-06-20 14:27:03 +03:00
7673ee685d Distinguish stopped and finished workers
By having a separate FINISHED state and a STOPPED state, it is possible to
know at which point in the worker's lifetime an event is done. Posting of
messages before a worker is started is allowed but posting them after the
worker has stopped is not.

This fixes avrorouter related failures and all other failures that stem
from worker messages being ignored at startup.
2019-06-20 12:32:30 +03:00
3d8475f8ed Merge branch '2.2' into 2.3 2019-06-19 12:37:23 +03:00
27fb397041 MXS-2547: Do shutdown on main worker
By stopping the REST API before the workers and moving the shutdown to the
same worker that handles REST API requests, we prevent the hang on
shutdown. This also makes the signal handler signal-safe.
2019-06-19 10:31:47 +03:00
69b3879357 MXS-2547: Don't post messages to stopped workers
If a worker has been stopped, tasks must not be executed on it. To prevent
this, the calling code should check whether the worker has been
stopped. This does not prevent the case where a message is successfully
posted to a worker but the worker is stopped before it processes it.
2019-06-19 10:31:47 +03:00
b7294a28af MXS-2547: Assert that workers aren't stopped
If a worker is stopped, none of the Worker::execute or post_message
methods should be called.
2019-06-19 10:31:47 +03:00
6cbe9d1258 MXS-2550: Fix default module parameters
The parameters weren't processed when they were added from the module
defaults.
2019-06-18 07:06:51 +03:00
95606370c8 MXS-2551 Do not print deprecated parameters into serialized config files
In MaxScale, a "deprecated" parameter is not in use and can be ignored.
Leaving the parameters out of serialized configuration files avoids warning
messages.
2019-06-11 15:55:35 +03:00
1ba77b59e2 MXS-2548 Show correct monitor state in "maxadmin list monitors"
The code OR:d with 0.
2019-06-06 17:09:41 +03:00
6d089e3283 Clear session commands in Backend::close
If a reconnection would take place, the old commands would get executed.
2019-05-31 14:01:15 +03:00
4e6ca33053 Add UBSAN flag to builds
The -DWITH_UBSAN flag enables the undefined behavior detection provided by
GCC.
2019-05-31 14:01:14 +03:00
2b3a9b2b57 Initialize MXS_SESSION::autocommit 2019-05-29 18:46:33 +03:00
eda547c86f MXS-1851: Add hard-coded protocol module check
This way a hard to track crash is avoided and the user knows how to fix
it.
2019-05-24 13:55:43 +03:00
b80aa081fe Fix test_buffer test case 2019-05-15 12:17:10 +03:00
01c4beec10 MXS-2470 Update tail pointer in gwbuf_clone 2019-05-14 13:36:33 +03:00
600e23ae2d MXS-2470 Add unit test that reveals problem 2019-05-14 13:36:33 +03:00
37bfe1cd67 Never exceed persistent connection limits
By doing the persistent connection count incrementation with CAS, value
can be guaranteed to never exceed the configured limit.
2019-05-10 09:11:39 +03:00
c72dbb6f46 MXS-2448: Fix connection counts of persistent DCBs
DCBs that were closed while they were persisted were double decremented.
2019-05-09 13:53:32 +03:00
d2e49c9591 MXS-2448: Assert that connection counts never go negative
The connections should never go below zero. It seems that at least pers_01
test suffers from this.
2019-05-09 13:06:27 +03:00
b313c6d0e7 MXS-2474 Ignore attempts to re-register a housekeeper task
It is an error to register the same task multiple times, but
for a maintenance release it is simpler and less risky to simply
ignore an attempt (that BLR does) to do that.

Allowing a task to be registered anew causes behaviour akin
to a leak.
2019-05-09 10:58:35 +03:00
a3cf1d22c0 MXS-2457 Streamline logging 2019-05-03 13:38:12 +03:00
f09d46c8e6 MXS-2457 Allow string arguments to be treated as fields
Before this change, the masking could be bypassed simply by

    > set @@sql_mode='ANSI_QUOTES';
    > select concat("ssn") from person;

The reason is that as the query classifier is not aware of whether
'ANSI_QUOTES' is on or not, it will not know that what above appears
to be the string "ssn", actually is the field name `ssn`. Consequently,
the select will not be blocked and the result returned in cleartext.

It's now possible to instruct the query classifier to report all string
arguments of functions as fields, which will prevent the above. However,
it will also mean that there may be false positives.
2019-05-03 13:38:12 +03:00
0d61522586 Fix test_adminusers
The test did not remove old inet user password files.
2019-05-02 12:53:42 +03:00
ba79028a46 Add debug assertions into the core
The assertions make sure DCB writes and reads are only done by the thread
that owns them.
2019-04-23 11:46:38 +03:00
61f728c05a MXS-2433: Reduce default query classifier cache size
Reduced the default cache size from 40% to 15%. Most cases don't benefit
from that much memory and the defaults have caused problems in live
environments.
2019-04-17 16:07:04 +03:00
d13e6e56ee MXS-2433: Never cache multi-packet queries
If a query spans more than a single packet, it will never be successfully
classified due to the fact that the complete SQL is never available to the
query classifier. For this reason, it is pointless to cache them.
2019-04-17 16:07:04 +03:00
1652b18a7b Fix whitespace in canonicalized queries
Trailing whitespace was not removed and whitespace wasn't normalized to
spaces.
2019-04-12 09:18:07 +03:00
9a5b60a071 Add forced maintenance mode tests
Tested that the force option works and is accepted.
2019-04-09 10:00:50 +03:00