12361 Commits

Author SHA1 Message Date
Markus Mäkelä
260ce9b8b8
MXS-2300: Add session command pruning
This commit adds a new parameter that, when enabled, prunes the session
command history to a known length. This makes it possible to keep a
client-side pooled connection open indefinitely at the cost of making
reconnections theoretically unsafe. In practice the maximum history length
can be set to a value that encompasses a single session using the pooled
connection with no risk to session state integrity. The default history
length of 50 commands is quite likely to be adequate for the majority of
use-cases.
2019-01-31 14:23:26 +02:00
Markus Mäkelä
bf4aa1ab2c
MXS-2295: Keep the COM_CHANGE_USER command
If the whole session command history is cleared, the COM_CHANGE_USER is
lost and the connections can end up using different users.
2019-01-31 14:23:26 +02:00
Markus Mäkelä
f39f27cd7b
MXS-2295: Session command loop test case
Test executes various session commands in a loop and makes sure a
COM_CHANGE_USER resets the history.
2019-01-31 14:23:26 +02:00
Markus Mäkelä
2e809524d1
MXS-2295: Reset session commands on connection reset
When the connection state is reset by executing a COM_CHANGE_USER or
COM_RESET_CONNECTION, readwritesplit does not need to store the session
command history that was executed before it. With this, pooled connections
will effectively behave like normal connections if the pooling mechanism
is smart enough to reset the connection. This also prevents unwanted
visibility into the session states of other connections.
2019-01-31 14:23:26 +02:00
Markus Mäkelä
24c9b62a2f
Add verbose logging for session command failures
If the routing of a session command fails due to problems with the backend
connections, a more verbose error message is logged. The added status
information in the Backend class makes tracking the original cause of the
problem a lot easier due to knowing where, when and why the connection was
closed.
2019-01-31 14:23:26 +02:00
Markus Mäkelä
df9335382d
Fix qc cache memory usage message
A zero value would get printed as -nanYiB.
2019-01-31 14:23:16 +02:00
Markus Mäkelä
da07672778
Fix query_classifier_cache_size
The query_classifier_cache_size was placed in the wrong section.
2019-01-31 14:23:16 +02:00
Markus Mäkelä
16fc920d33
MXS-2299: Hints always take precedence
Hints should override all statement level routing decisions that would
otherwise be done based on the query type.
2019-01-28 18:36:52 +02:00
Markus Mäkelä
6d88afbf55
MXS-2038: Fix debug assertion
A query that is classified as a write but has a hint that tells to route
it to a slave is not unexpected ever since the 2.1 version of MaxScale.
2019-01-28 18:36:52 +02:00
Markus Mäkelä
f335dba2c0
Fix stack buffer overflow in compare
The buffer was three characters short.
2019-01-28 17:35:27 +02:00
Esa Korhonen
6322fd37bf Merge branch '2.2' into 2.3 2019-01-28 15:34:09 +02:00
Markus Mäkelä
b078eb2cca
Add server state to routing hint log message
If a server was not chosen as the target of a routing hint, the server
status would not be logged. By logging the server state in the message, it
is easier to figure out why a server wasn't chosen as the routing target.
2019-01-28 09:27:13 +02:00
Markus Mäkelä
2c95119a3b
Replace STRTARGET macro
The macro was extremely unwieldly to update and made the addition of debug
assertions harder. Rewriting it as an inline function makes this possible.
2019-01-28 09:27:13 +02:00
Johan Wikman
9f1619f4da MXS-2225 Provide documentation regarding default max[admin|ctrl] user 2019-01-25 12:45:25 +02:00
Esa Korhonen
0f26a8bed6 MXS-2112 Add system info to support info script 2019-01-24 16:52:47 +02:00
Esa Korhonen
cdabee6f06 MXS-2269 Explain PAM anonymous group mapping 2019-01-24 16:48:07 +02:00
Esa Korhonen
97c0c76321 MXS-2267 Document requirements for an accepted PAM user
The requirements are typical of MaxScale authenticators.
Also, fixes the fallback PAM service.
2019-01-24 16:44:34 +02:00
Markus Mäkelä
c061f45d52
Update links in example configuration
The links were out of date and pointed to 2.2.
2019-01-24 16:14:38 +02:00
Johan Wikman
09958afd61 Merge branch '2.3.3' into 2.3 2019-01-23 15:39:15 +02:00
Johan Wikman
f54d015267 Update 2.3 maintenance version 2019-01-21 13:43:53 +02:00
Johan Wikman
d350589ce1 Update 2.3.3 release date 2019-01-21 13:43:53 +02:00
Markus Mäkelä
5b7c63fef7 Fix quoted value skipping
The return value wasn't checked and the code assumed that a non-end
iterator was always returned.
2019-01-21 13:43:53 +02:00
Markus Mäkelä
9542641dae Fix buffer overrun on non-terminated comment
Also made the behavior consistent when an incomplete comment is found.
2019-01-21 13:43:53 +02:00
Johan Wikman
b4de91e02e Update 2.3.3 release date 2019-01-21 13:28:30 +02:00
Esa Korhonen
7f978f275f MXS-2223 Log a message when a slave is discriminated due to replication lag
Both the replication lag and the message printing state are saved in SERVER,
although the values are mostly used by readwritesplit. A log message is printed
both when a server goes over the limit and when it comes back below.
Because of concurrency issues, a message may be printed multiple times before
different threads detect the new message state.

Documentation updated to explain the change.
2019-01-21 13:02:18 +02:00
Markus Mäkelä
28644e9626
Fix quoted value skipping
The return value wasn't checked and the code assumed that a non-end
iterator was always returned.
2019-01-18 10:25:12 +02:00
Markus Mäkelä
2e95812b71
Fix buffer overrun on non-terminated comment
Also made the behavior consistent when an incomplete comment is found.
2019-01-18 10:24:59 +02:00
Johan Wikman
0dfdff1f95 Update 2.3.3 release notes and change log 2019-01-17 11:11:04 +02:00
Johan Wikman
95f6786b3c Update 2.3.3 release notes and change log 2019-01-17 11:02:12 +02:00
Markus Mäkelä
92b50196ed
Merge branch '2.3.3' into 2.3 2019-01-17 10:49:37 +02:00
Markus Mäkelä
a469ef83b6
MXS-2217: Pick DCB owner before adding to epoll
There is a race condition between the addition of the DCB into epoll and
the execution of the event that initiates the protocol pointer for the DCB
and sends the handshake to the client. If a hangup event would occur
before the handshake would be sent, it would be possible that the DCB
would get freed before the code that sends the handshake is executed.

By picking the worker who owns the DCB before the DCB is placed into the
owner's epoll instance, we make sure no events arrive on the DCB while the
control is transferred from the accepting worker to the owning
worker.
2019-01-17 10:35:49 +02:00
Markus Mäkelä
ba393dbfb2
Merge branch '2.3.3' into 2.3 2019-01-16 16:23:56 +02:00
Markus Mäkelä
519cd7d889
Don't call python3 directly
Calling it directly from the script adds a dependency on it and we don't
what that.
2019-01-16 16:19:35 +02:00
Markus Mäkelä
68d33a3ae4
MXS-2266: Add test case
Extended the existing tests to cover MXS-2266.
2019-01-16 16:19:35 +02:00
Markus Mäkelä
317166540f
MXS-2266: Close prepared statements with internal ID
The ID used to store the prepared statements uses the internal ID and
using the external ID caused unwanted memory use and a false warning.
2019-01-16 16:19:35 +02:00
Markus Mäkelä
39dc83f13c
Don't call python3 directly
Calling it directly from the script adds a dependency on it and we don't
what that.
2019-01-16 16:00:32 +02:00
Markus Mäkelä
1e1836354b
MXS-2257: Extend password encryption tutorial
Fixed the documentation on the arguments to maxkeys, which is a directory,
and added a short paragraph about alternative key file locations. Also
documented that keys are read from the directory where the `datadir`
parameter points to.
2019-01-16 13:33:14 +02:00
Markus Mäkelä
7181ea4083
MXS-2266: Add test case
Extended the existing tests to cover MXS-2266.
2019-01-16 12:22:06 +02:00
Markus Mäkelä
ba40916d4a
MXS-2266: Close prepared statements with internal ID
The ID used to store the prepared statements uses the internal ID and
using the external ID caused unwanted memory use and a false warning.
2019-01-16 12:22:06 +02:00
Markus Mäkelä
f5f6a12484
Start Galera correctly
The Galera documentation tells us to use the galera_new_cluster command to
start a new Galera cluster. This should prevent the problems of nodes
failing to join the cluster either on the initial startup or after a node
goes down.
2019-01-16 10:01:58 +02:00
Markus Mäkelä
511f01a28d
MXS-2252: Add test case
Added a test case that verifies the correct user is used.
2019-01-16 09:43:50 +02:00
Markus Mäkelä
db98ecbaa1
MXS-2259: Fix double addition of DCBs to worker list
When poll_add_dcb was called for a DCB that once was polling system but
was subsequently removed, the DCB would appear twice in the worker's list
of DCBs. This caused a hang when the DCB was the last one in the worker's
list and dcb_foreach_local would be called.

To prevent the aforementioned problem, the DCBs are now added and removed
directly to and from the workers instead of indirectly via poll_add_dcb
and poll_remove_dcb.
2019-01-16 09:43:50 +02:00
Markus Mäkelä
57fe5ff56a
Fix error packet stringification function
The code read past the stack buffer.
2019-01-16 09:43:49 +02:00
Markus Mäkelä
021d48f94c
Log low-level reason and idle time on master failure
If the connection to the master is lost, knowing what type of an error
caused the call to handleError helps deduce what was the real reason for
it. Logging the idle time of the connection helps detect when the
wait_timeout of a connection is exceeded.
2019-01-16 09:43:49 +02:00
Markus Mäkelä
9def07ab4a
Document connection_timeout behavior
The fact that a warning is logged was not documented.
2019-01-15 18:42:20 +02:00
Esa Korhonen
8cef8b9472 Compile MariaDBMonitor unit tests only if flag is set 2019-01-15 15:44:21 +02:00
Esa Korhonen
1c8c222ad1 MXS-2112 Add python script for assembling support files
The script adds config and log files into a zip archive. Passwords in
config files are censored. Also attempts to read current status by calling
maxctrl. If core-file exists, runs gdb on it to gather call stack.
The script is installed to the binary file directory.
2019-01-14 16:34:30 +02:00
Markus Mäkelä
bec33be672
Backport to 2.2: Simplify mxs1743_rconn_bitmask
The test now uses maxctrl to count how many connections there are. This
helps avoid creating new users on the database and works around the slave
syncing problems.
2019-01-11 13:13:04 +02:00
Johan Wikman
34359bdc83 Merge branch '2.2' into 2.3 2019-01-11 13:02:43 +02:00
Johan Wikman
9284e8e64c Merge branch '2.2.19' into 2.2 2019-01-11 13:02:05 +02:00