Commit Graph

4289 Commits

Author SHA1 Message Date
cf8ff493bc Add query canonicalization profiling
A small helper program like this helps figure out performance problems
with the function.
2019-10-29 09:26:41 +02:00
8258e14bfe Add minor optimizations to get_canonical
Requiring contiguous buffers removes the need to use mxs::Buffer which
also removes the need to check for buffer boundaries.

Converted all the functions used by get_canonical into `static inline` so
that the compiler knows it can inline them. A few of them weren't `static`
which made the calls to the functions unnecessarily expensive.
2019-10-29 09:26:41 +02:00
7f41bfa5f8 Fix minor defect in get_canonical
The backslash was added instead of assigned. Since the value stored at
that position is always a null byte, assignment and addition would result
in the same outcome.
2019-10-29 09:26:41 +02:00
d6eb73c9ee MXS-2639: Fix maxinfo memory leak
The JSON version didn't call json_decref on the object it created.
2019-10-29 09:26:41 +02:00
c609042874 MXS-2706: Fix maxinfo JSON output
The output now correctly formats integers.
2019-10-29 09:26:41 +02:00
ff73bc778e MXS-2728: Give maxscale ownership of the .secrets file
Since most of the time users run MaxScale as the maxscale user, we can
change the ownership of the file when it is being created. This prevents
the need to manually set the permissions after the file is created.

If the user creating the file is root, the ownership change will work but
on the other hand if the user simply has write permission into MaxScale's
files, the ownership change will likely cause an error. This will still be
an improvement as the user will know the file ownership needs to be
changed.
2019-10-25 16:22:11 +03:00
dc895e41ad Merge branch '2.3' into 2.4 2019-10-11 09:51:48 +03:00
183673b026 MXS-2720: Fix service session count
The number of sessions wasn't always incremented but it was always
decremented. This happened primarily when authentication failed. By making
the management of the counters a part of the object lifecycle, this
problem goes away.
2019-10-10 21:34:03 +03:00
c9da7c2727 MXS-2720: Assert that client count is non-negative 2019-10-10 21:24:36 +03:00
067b1cfbc1 Add query canonicalization profiling
A small helper program like this helps figure out performance problems
with the function.
2019-10-10 21:24:35 +03:00
dc4e35e60d Add minor optimizations to get_canonical
Requiring contiguous buffers removes the need to use mxs::Buffer which
also removes the need to check for buffer boundaries.

Converted all the functions used by get_canonical into `static inline` so
that the compiler knows it can inline them. A few of them weren't `static`
which made the calls to the functions unnecessarily expensive.
2019-10-10 21:24:35 +03:00
6ea2adef12 Fix minor defect in get_canonical
The backslash was added instead of assigned. Since the value stored at
that position is always a null byte, assignment and addition would result
in the same outcome.
2019-10-10 21:24:35 +03:00
56defbfdec MXS-2639: Fix maxinfo memory leak
The JSON version didn't call json_decref on the object it created.
2019-10-09 08:41:51 +03:00
026109f9bc MXS-2706: Fix maxinfo JSON output
The output now correctly formats integers.
2019-10-09 08:41:51 +03:00
64d19cf018 MXS-2711: Fix updating of retain_last_statements
The value is now correctly expected to be a non-negative integer.
2019-10-04 09:42:03 +03:00
237cdd798b MXS-2687: Detect invalid socket arguments
Cherry-pick of 5a94f09cb97d7da5ca4a71b398f14ec32e6c90e7.
2019-10-03 09:29:52 +03:00
7f7b052f0e Print stacktrace in one message
By printing the stacktrace in one log message, it prevents it from
interleaving with other messages. This happens on busy systems and makes
crash analysis harder.
2019-10-02 10:44:57 +03:00
27675ed41d MXS-2354: Fix subsecond part of temporal values
TIMESTAMP2, DATETIME2 and TIME2 values with decimal parts are now
correctly converted into their string forms. Previously the decimal part
was ignored but most of the code required to extract it was in place.
2019-09-30 11:47:29 +03:00
19487d2bfb Merge branch '2.3' into 2.4 2019-09-20 09:36:23 +03:00
f587ec191d MXS-2688 Add QC operator QUERY_OP_SET
Allows RWS to unconditionally send all SET-statements to
all servers.
2019-09-20 09:27:38 +03:00
78cc5b2445 Move packet_tracker.cc under maxscale
It depends on MaxScale-types. This also removes the maxsql-pcre2-dependency.
2019-09-18 12:19:09 +03:00
1f26189ddd Merge branch '2.3' into 2.4 2019-09-17 14:55:34 +03:00
dabab543cc MXS-2684 Add throttling callbacks to backend DCB from pool
Add throttling callbacks to a backend DCB taken from the persistent
pool. They were removed when the dcb was put into the pool.
2019-09-17 14:45:53 +03:00
31029eaec8 MXS-2675: Fix server creation with TLS via REST API
The TLS parameters were defined but the main parameter that enables it
wasn't automatically added. As the REST API documentation states that this
parameter does not need to be defined, the runtime configuration must add
it.
2019-09-13 14:14:34 +03:00
ebbd806c6a Merge branch '2.3' into 2.4 2019-09-06 10:59:08 +03:00
00feb61b23 MXS-2652 Do not clear maintenance flag when a server goes down
The set of flags to clear should be well-defined.
2019-09-06 09:43:32 +03:00
68f3b235e1 MXS-2650 Fix SSL-use with Connector-C
Authenticators and monitors now use SSL when configured. The fix has two parts:
1) Removed the extra SSLConfig inside SSLProvider, as SSLContext already contains
the config.
2) When inputting parameter values to mysql_ssl_set(), empty strings are converted
to NULL-pointers as the function expects those for unused values.
2019-08-29 17:46:26 +03:00
5a7c68e3c9 MXS-2612 Ensure that destructor order does not matter
The new configuration system relieas upon static varibles being
used for declaring what arguments a particular module uses. To
ensure that the destruction order does not matter, we redundantly
store the needed data (the name).
2019-08-29 08:01:35 +03:00
8ce6a679be Merge branch '2.3' into 2.4 2019-08-09 19:44:46 +03:00
5899556d89 MXS-2592 Enable runtime configuration of session_trace 2019-08-09 19:36:24 +03:00
bf551c5b1e Merge branch '2.3' into 2.4 2019-08-09 03:01:00 +03:00
547236b7a4 MXS-2609: Store history size in Backend
When a connection is created, the size of the history that is about to be
replayed is known. Storing this and decrementing it each time a session
command is completed tells us when the Backend has finished replaying the
session command history. This can then be used to distinguish whether a
session command executed on a master should be retried or whether to
simply discard the connection.
2019-08-09 01:54:09 +03:00
d3e199ff1d Use old default parameter definitions in config2.cc
This prevents problems when 2.3 is merged into 2.4 and it contains new
common parameters with defaults.
2019-08-05 15:06:25 +03:00
1514a77345 Improve main thread detection
Now properly checks if configuration and diagnostics functions are ran in either
main() or in the admin worker. This is useful for debugging and enforcing
thread safety.

Also, monitors are now started and stopped in the admin worker.
2019-07-31 12:36:05 +03:00
ed84f29fca MXS-2612 Free routing worker local data
When a RoutingWorker is destructed, all existing local data will
unconditionally be destroyed.

The case in point is the vector<SFilterDef>s that are held as routing
worker local data by the Service. Unless the local data is deleted, the
filter defs will not be deleted at shutdown.

This is somewhat brute-force (but good to have in place nonetheless) as
the deletion of the local data should be done by the Service and before
the routing worker thread has exited.
2019-07-30 13:01:12 +03:00
a9b01ff4cc Merge branch '2.3' into 2.4 2019-07-28 21:43:58 +03:00
918a2964d5 MXS-2592 Add configuration for session specific in-memory log
When enabled each session will write log messages in the in-memory log.
If session ends in error this log is written to the actual log in disk.
2019-07-28 20:56:22 +03:00
d4b712ae84 MXS-2546 Add DNS-resolving to topology detection
When matching hostnames between MaxScale server configuration and the
SHOW SLAVE STATUS-output, use DNS-resolution if a simple string comparison
doesn't find an answer. Results of the resolution are saved to avoid
repeating the operation for the same address.
2019-07-22 11:10:23 +03:00
835049d506 Merge branch '2.3' into 2.4 2019-07-19 12:25:26 +03:00
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
5b3c0b8b81 Merge branch '2.3' into 2.4 2019-07-16 13:17:35 +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
f9b1a0a0c4 Merge branch '2.3' into 2.4 2019-07-10 08:17:34 +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