Commit Graph

2926 Commits

Author SHA1 Message Date
3e85500491 Merge branch '2.3' into 2.4 2019-07-02 08:38:15 +03:00
4954c7f6b7 Fix sending of unknown PS error
The error was only generated for COM_STMT_EXECUTE commands when all PS
commands should trigger it. In addition, large packets would get sent two
errors upon the arrival of the trailing end.
2019-07-01 10:25:41 +03:00
3b6387c952 MXS-2562: Stop immediately on mid-resultset failure
If a server fails mid-resultset, there's not a lot we can do to recover
the situation. A few cases could be handled (e.g. generate an ERR if the
resultset has proceeded to the row processing stage) but these fall
outside the scope of the original issue.
2019-06-28 20:25:31 +03:00
5dca53f877 Merge branch '2.4.0' into 2.4 2019-06-28 17:58:01 +03:00
fcc19f3c66 Merge branch '2.3' into 2.4 2019-06-27 08:53:33 +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
d45915c279 Treat empty avro filenames as an error
If an empty filename is requested, treat it as an error.
2019-06-26 10:17:21 +03:00
01822490ca Fix avrorouter and cluster usage
The servers defined by `cluster` wouldn't get used.
2019-06-26 10:17:21 +03:00
0ba779d5a2 Update 2.4.0 Change Date 2019-06-25 10:11:55 +03:00
2ab9aa9a94 Update 2.4.0 Change Date 2019-06-25 09:19:55 +03:00
278c26cd54 Fix build failure
mxs::rtrim was renamed to mxb::rtrim.
2019-06-20 23:17:41 +03:00
0b67ce1e82 Merge branch '2.3' into develop 2019-06-20 14:36:48 +03:00
be429c2c57 MXS-2490: Always restore original statement ID
By always restoring the ID, we are guaranteed to only store the query in
the form that it was originally sent in. This should be changed so that
the ID that the client sends can be used as-is in the backends.
2019-06-20 14:27:04 +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
20f595d978 Merge branch '2.3' into develop 2019-06-20 13:00:13 +03:00
301b1b63ab MXS-2569: Always terminate schemas with newlines
If the stored file didn't have a newline in the schema, the schema and the
first row would be on the same line.
2019-06-20 12:32:30 +03:00
197d577aa1 Set correct replication lag state
The lag state was inverted.
2019-06-19 17:35:19 +03:00
2bd614ce8e MXS-2566: Use connection counts more often
The connection counts are now always used to pick the best servers where
the initial connections are created. This covers both master and slaves
selection. Reconnections done while routing queries still pick the "best"
server according to the slave selection criteria. This allows better
servers to be taken into use when `lazy_connect` is enabled.
2019-06-19 16:12:28 +03:00
ef3136c5c9 MXS-2555 Fix split packet bug in smart session.
The test failed to notice that the split request session was left in a
bad state after the split query had (succesfully) finished.
2019-06-19 15:31:34 +03:00
6ba1c277be MXS-2555 Fix a few TODOs and other cleanup 2019-06-19 15:31:34 +03:00
a950715176 MXS-2555 Implement cache eviction (or query re-measurment) strategy 2019-06-19 15:31:34 +03:00
f7d44835a7 MXS-2555 Use mxs_mysql_execute_kill_all_others in smartrouter 2019-06-19 15:31:34 +03:00
56e5c417c1 MXS-2555 uncrustify mysql_common.cc, and a minor bug fix in smartrouter.cc 2019-06-19 15:31:34 +03:00
6a7b6d4b89 MXS-2555 Beta Smart Router.
1. Remove persistence of performance data
2. Move global CanonicalPerformance into SmartRouter object
3. Implement another kill_all_others_v2. Left kill_all_others_v1
    in case it should be fixed and used instead.
2019-06-19 15:31:34 +03:00
1241300494 MXS-2555 Simple Smart Router
Does the measurments, usage of the same  and persistence to file.
Kill is not implemented, so waits for all clusters to fully responds

The performance data uses a mutex and the persistence data file
is written while holding the mutex. This obviously needs to be
improved, but this commit shows the working concept.
2019-06-19 15:31:34 +03:00
c47a2d32fa Fix mxs1980_blr_galera_server_ids
A housekeeping task cannot be removed by name from within the
task function itself. Instead the function must simply return
false.
2019-06-19 15:27:09 +03:00
64d25a48bd Merge commit 'a60bd376108f71fccf40001c1496f32c11137fe4' into develop 2019-06-18 15:51:17 +03:00
f6a5b59067 MXS-2563: Fix query retrying on slave failure
If one slave is executing a query while another one is executing a session
command and the one that is executing the session command fails, the
ongoing query would get retried even though the server that failed was not
executing it. If the server was executing a session command, nothing needs
to be done.
2019-06-17 14:07:52 +03:00
f8729c272e Erase trailing unexpected ERR packets
If a resultset is followed by an ERR packet that is not expected
(e.g. server is shutting down), the packet must not be sent to the
client. This allows readwritesplit to replace the failing connection with
a new one thus hiding server shutdowns from clients.
2019-06-14 15:18:02 +03:00
7dde0edb54 Clean up unexpected error handling in readwritesplit
By using the Error class, the code can be cleaned up and simplified.
2019-06-14 15:18:01 +03:00
470968a296 Fix unit test failures
The new net_write_timeout value needed to be explicitly defined for the
tests.
2019-06-11 21:38:47 +03:00
40851f8a30 MXS-2556 Use configured master 2019-06-11 12:07:27 +03:00
ba4099799f MXS-2556 Add persist_performance_data arg to smartrouter 2019-06-11 11:59:08 +03:00
04fdaf1fdb MXS-2556 Make config::Configuration aware of its object
The name of the object (i.e. the section name from the configuration
file), is now stored in the configuration object for that object.

That way, more contextual and hence morfe user friendly errors and
warnings can be generated.
2019-06-11 11:05:15 +03:00
df5377f135 MXS-2556 Check if TCP/IP socket is used and warn about it
If the server (a real one or a service exposed as a server) is
on the same machine as MaxScale, then for performance reasons
a Unix domain socket and not a TCP/IP socket should be used.
2019-06-11 10:48:42 +03:00
acdc3b2396 MXS-2556 Add master configuration handling to SmartRouter 2019-06-11 09:46:04 +03:00
e1b611aa06 MXS-2512 Use existing information
As an error returned by the server is now stored inside RWBackend,
irrespective of whether it is returned solely or e.g. last after
a result set, there is no need to examine the GWBUF in rws, but
we can use the information that exists.
2019-06-11 09:44:27 +03:00
190c0ac634 MXS-2437 Base router for Smart Router.
This is the base for Smart Router. Review and TODO comments are in the
code. This commit will be squashed several times so don't pay attention to this
specific commit message. I will add and remove TODO's in the code, rather
than save them in git commits. RBCommons will contain the history.
2019-06-10 14:40:39 +03:00
4efa9dbeea Remove maxscale/alloc.h
The remaining contents were moved to maxbase/alloc.h.
2019-06-10 14:11:25 +03:00
655e5fab5b Move length-encoded integer/string functions to maxsql 2019-06-07 11:32:46 +03:00
44d1b821c3 Merge branch '2.3' into develop 2019-06-03 13:54:55 +03:00
220fea3546 MXS-2464: Retry failed session commands
If the execution of a session command fails on a master, it is retried
again. If the master is not available, the response will be returned from
one of the slaves.
2019-05-31 14:01:15 +03:00
cb089f69e6 Add read retry assertion
The retrying of a read on a slave should only be done when the failing
server is waiting for a result and it was the last server from which a
result was expected.
2019-05-31 14:01:15 +03:00
625740e69d MXS-2464: Fix crash on failed session command
If the master fails when a session command is being executed with
delayed_retry enabled, a null query would get placed into the query
queue. This change simply prevents the crash and closes the session even
though the query could be retried.
2019-05-31 14:01:15 +03:00
ee7e63a611 MXS-2464: Assert that responses are expected
A query should not be queued if no responses are expected. The code that
executes queued queries should be dead code and this assertion would catch
it.
2019-05-31 14:01:14 +03:00
81254953d1 MXS-2520: Allow master reconnection on reads
If only the master is available and a reconnection must take place, it
must be allowed to happen in all cases.
2019-05-29 18:46:33 +03:00
2ddc20cf9e Merge branch '2.3' into develop 2019-05-28 15:19:10 +03:00
dcdcc0e44f Fix avrorouter build failure
Signed to unsigned comparison.
2019-05-28 15:18:34 +03:00
65c795164c Merge branch '2.3' into develop 2019-05-28 14:40:45 +03:00
0462ac3d16 MXS-2483: Update documentation and release notes
Updated documentation on how servers with TLS are created.
2019-05-28 14:34:51 +03:00