7515 Commits

Author SHA1 Message Date
Johan Wikman
32f2e769f4 MXS-1780 Make retain_last_statements service specific 2018-11-08 12:08:42 +02:00
Johan Wikman
2bd2b4a32e MXS-1780 Report times using localtime instead of gmtime 2018-11-08 12:08:42 +02:00
Johan Wikman
dd712a06fa MXS-1780 Make statement retaining session specific
Whether or not a session should retain its statements is now
a property of the session. This in preparation for making the
whole functionality a property that can be enabled and disabled
at runtime, of the service.
2018-11-08 12:08:42 +02:00
Johan Wikman
c899f00541 MXS-1780 Collect server response information
As the router is the only one that knows what backends a particular
statement has been sent to, it is the responsibility of the router
to keep the session bookkeeping up to date. If it doesn't we will
know what statements a session has received (provided at least some
component in the routing chain has RCAP_TYPE_STMT_INPUT capability),
but not how long their processing took. Currently only readwritesplit
does that.

All queries are stored and not just COM_QUERY as that makes the
overall bookkeeping simpler; at clientReply() time we do not need to
know whether or not to bookkeep information, we can just do it.

When session information is queried for, we report as much information
we have available.
2018-11-08 12:04:55 +02:00
Johan Wikman
c78c5a615d MXS-1780 Store time when statement was received 2018-11-08 12:03:50 +02:00
Johan Wikman
c6378e1006 MXS-1780 Make retained statements available via REST-API 2018-11-08 12:03:50 +02:00
Johan Wikman
fa13b8036a MXS-1780 Store last statement as cloned GWBUF
The last statements of a session are now stored as a cloned
GWBUF instead of as a copy of the SQL.
2018-11-08 12:03:50 +02:00
Niclas Antti
3ccdb508de Fix bug in roulette wheel
Slot values were changed after the total was calculated. Fix bug
and adjust the offending code.
2018-11-08 10:50:23 +02:00
Niclas Antti
c692c864e2 MXS-2078 Take new statistics into use 2018-11-08 10:44:32 +02:00
Niclas Antti
5175d2b2d7 MXS-2078 Add support for holding router specific server data.
New class to hold the statistics, part of which is currently in
RWSplitSession. Simple API in Backend to create session
specific data.
2018-11-08 10:44:32 +02:00
Esa Korhonen
fb3ccc94d6 MXS-1944 Cleanup function parameters
The naming and ordering is now a bit more consistent between promote() and demote().
2018-11-07 12:55:59 +02:00
Esa Korhonen
e4e2235297 MXS-1944 Use time limited methods in rejoin
Uses switchover time limit, since the typical rejoin of a standalone server
is somewhat similar to a switchover.
2018-11-07 12:55:59 +02:00
Esa Korhonen
184e187732 Different cluster operations use different parameter types
Only the parameters used by all operations are in the common class.
2018-11-07 12:55:59 +02:00
Esa Korhonen
a4ce4e4613 MariaDBServer no longer uses ClusterOperation
The functions in the server class now only use the general parameters object.
2018-11-07 12:55:59 +02:00
Esa Korhonen
8877e7180b Continue separation of ClusterOperation elements 2018-11-07 12:55:59 +02:00
Esa Korhonen
90e6ff078a Divide ClusterOperation to two types
The main class was getting unwieldly and too general. Dividing the fields
helps adding support for other operation types.

This commit leaves most data duplicated, later commits clean up the affected code.
2018-11-07 12:55:59 +02:00
Markus Mäkelä
4daffb5e2f
MXS-2147: Fix luafilter includes
The filter now correctly includes C headers.
2018-11-06 21:35:53 +02:00
Markus Mäkelä
11a756a028
Detect undefined references at link time
Instruct the linker to make sure all symbols are resolved at link time.
2018-11-06 21:34:28 +02:00
Markus Mäkelä
774e9d1efb
Fix merge problems
The values were not removed from the merge.
2018-11-06 21:18:42 +02:00
Markus Mäkelä
383b0b1989
Merge branch '2.2' into 2.3 2018-11-06 21:12:20 +02:00
Markus Mäkelä
a99ab62cb7
MXS-2136: Convert 'passwd' to 'password'
The old 'passwd' parameter is now converted to the 'password' parameter
and a warning about its deprecation is logged. This keeps the mandatory
parameter detection functional while still allowing old-style
configurations to be used.
2018-11-06 15:09:14 +02:00
Markus Mäkelä
f7f6bcea9e
Add parameter name suggestions
If an unknown parameter is detected, a suggestion is now given from the
set of known parameters if they are similar enough.
2018-11-06 15:09:14 +02:00
Markus Mäkelä
113b1503f6
Expand readwritesplit delayed retry error message
The error now explains if the write failure was due to the
delayed_retry_timeout being reached.
2018-11-06 15:09:14 +02:00
Markus Mäkelä
4341c2b6e2
MXS-2142: Set causal_reads_timeout default to 10
The causal_reads_timeout default value is too long when considering the
behavioral changes that MXS-2141 introduced. With a 10 second default
value, a result is returned to the client in a reasonable amount of time.
2018-11-06 15:09:14 +02:00
Markus Mäkelä
e56372b153
MXS-2141: Retry query on master if it times out on slave
With causal_reads enabled, the query would return with an error if the
slave was not able to catch up to the master fast enough. By automatically
retrying the query on the master, we're guaranteed that a valid result is
always returned to the client.
2018-11-06 15:09:14 +02:00
Markus Mäkelä
c661f5e838
MXS-2139: Extend transaction_replay requirements
Enabling transaction_replay now automatically enables
master_failure_mode=fail_on_write. This makes the behavior consistent
across all failure modes.
2018-11-06 15:09:14 +02:00
Markus Mäkelä
95745f5a4e
MXS-2140: Fix readwritesplit configuration processing
Runtime configuration changes did not properly enable implicitly enabled
parameters.
2018-11-06 15:09:14 +02:00
Esa Korhonen
b05385e0ac Cleanup monitor stop/start during runtime modification
The stop/start between different callers of do_alter_monitor was
confusing.
2018-11-06 11:44:50 +02:00
Esa Korhonen
fe3900be0e MXS-2102 Allow runtime change of disk_space_threshold for monitor
This is currently disallowed for the server parameter, as the value could be
read/written concurrently. The monitor parameter can be changed since the
monitor is stopped during write.
2018-11-06 11:44:50 +02:00
Esa Korhonen
c5a54d2fe9 Disallow switchover promotion of a server low on disk space
This protects the user and also prevents a neverending series of
automatic switchovers in the case when all servers are low.
2018-11-06 11:44:50 +02:00
Esa Korhonen
2c280e27f2 Free qc thread resources at worker exit 2018-11-06 11:44:50 +02:00
Johan Wikman
6dc038aa4e MXS-2137 Remove meaningsless statistics
The removed statistics variables have no meaning anymore and
were not updated.
Decided to simply drop the variable from the JSON output. It
gets far too rigid if fields of objects cannot be changed without
bumping the REST-API version.
2018-11-06 09:49:25 +02:00
Markus Mäkelä
b1c469259c
MXS-1467: Create csmon
Added the csmon monitor which supports both old and new ColumnStore
servers. As older server versions aren't able to express their role, the
master needs to be designated by the user. When a ColumnStore version is
released that supports the mcsSystemPrimary() function, the master can be
automatically found.
2018-11-05 23:24:06 +02:00
Markus Mäkelä
ab70231c12
Fix per thread memory use log message
The query classification cache size was not correctly calculated for the
message.
2018-11-05 13:43:22 +02:00
Markus Mäkelä
b8a595a0e6
Fix DCB closing debug assertion
The assertion for a DCB with a fd of -1 needs the internal DCBs as well
since they do not have valid file descriptors.
2018-11-05 13:43:22 +02:00
Markus Mäkelä
a9041a74f1
MXS-2106: Update schema generation scripts
Updated the schemas generated by the scripts. Also added a
requirements.txt for installing all of the python dependencies.
2018-11-05 13:37:29 +02:00
Markus Mäkelä
562c7be8fe
MXS-2106: Fix NULL value handling
The NULL values were not stored as NULL Avro values due to the fact that
the file format has no native NULL-ness for the basic types. To solve
this, all values must be stored as a union that contains the actual type
as well as the null type.

Unions were not implemented in the maxavro library but implementing means
simply recursing one level down.
2018-11-05 13:37:29 +02:00
Markus Mäkelä
7f36ec83da
MXS-2095: Add runtime detection of unknown SQL
If the query statement is wrongly treated as a table creation statement it
could cause a crash. To handle this, unknown SQL is now reported and the
processing is stopped early. This does not solve the root cause of the
problem but makes it possible to detect it in the future.
2018-11-05 13:37:28 +02:00
Niclas Antti
f8c132903b Fix query average measurment and average text output.
The query_ended() call was not in the right spot. Tests did not
detect it. Changed textual output to reflect the fact that they
are for RWSplit reads.
2018-11-04 17:18:09 +02:00
Johan Wikman
84d45447fc Fix formatting 2018-11-02 11:27:37 +02:00
Markus Mäkelä
e5d6e5329a
Format source code
Formatted all of the source code that was not accordance with the coding
style. This was caused by merges from 2.2 into 2.3.
2018-11-01 14:05:15 +02:00
Johan Wikman
f34ca0d473 Fix peculiar wrapping 2018-11-01 12:39:18 +02:00
Johan Wikman
cab40c54e4 Merge branch '2.2' into 2.3 2018-11-01 10:52:42 +02:00
Toni Zlomislic
e1dedfb678 Update galeramon.c (#183)
* Update galeramon.c

support wsrep_sst_method "xtrabackup-v2" for available_when_donor maxscale option

* reformat line to fit <=110 chars / support xtrabackup-v2 sst method
2018-10-31 16:00:26 +02:00
Johan Wikman
a349f0ad0d MXS-1779 Implement the classify REST-API 2018-10-31 10:19:40 +02:00
Johan Wikman
3631388f75 MXS-1779 Add initial support for classification URL
This commit introduces the plumbing support for obtaining
classification information of a statement using the REST-API.
It introduces a URL like

    /v1/maxscale/query_classifier/classify?sql=SELECT+1

that in the response will return a JSON object with the
information. Subsequent commits will provide the actual
information.
2018-10-31 10:19:40 +02:00
Markus Mäkelä
cd92b6d4d7
MXS-2122: Close listener socket on destruction
Even though directly closing the socket is not very neat in the
architectural sense of things, it allows the best of both worlds: the
socket is instantly closed and is open for reuse while the listener struct
is still available as a reference.

This change needs to be revised when the listeners are refactored into
separate objects.

Updated documentation to reflect the change in behavior.
2018-10-31 09:53:50 +02:00
Markus Mäkelä
47d2898818
MXS-2121: Allow destruction of static listeners
If a listener is defined in a static configuration file, it can now be
destroyed at runtime. If MaxScale is restarted, the listener will be
created again unless the configuration file is modified.
2018-10-31 09:53:49 +02:00
Markus Mäkelä
906d8cee5b
Format all files
Formatted all files with uncrustify.
2018-10-31 09:46:02 +02:00
Markus Mäkelä
8d1b26060a
MXS-2109: Change semantics of query_classifier_cache_size
The cache size now refers to the total memory used by the cache instead of
the per thread limit. This makes it easier to use as well as more
predictable by removing the dependency on the number of worker threads.
2018-10-31 09:46:02 +02:00