Commit Graph

5072 Commits

Author SHA1 Message Date
4c5e18b4f0 MXS-2033: Require only MASTER_SSL_CA
MASTER_SSL_CERT and MASTER_SSL_KEY are optional and should not be
required.
2018-08-30 00:30:46 +03:00
5f4aa46552 MXS-2027: Store LOAD DATA state inside MXS_SESSION
By storing the data gathere by readwritesplit inside the session, the
protocol will be aware of the state of the LOAD DATA LOCAL INFILE
execution. This prevents misinterpretation of the data which previously
led to closed connections, effectively rendering LOAD DATA LOCAL INFILE
unusable.

This change is a temporary solution to a problem that needs to be solved
at the protocol level. The changes required to implement this are too big
to add into a bug fix release.
2018-08-29 18:10:51 +03:00
e38e08089a Skip parsing during LOAD DATA LOCAL INFILE
The code parsed queries even when a LOAD DATA LOCAL INFILE was in
progress. This caused the data to be misinterpreted as actual commands.
2018-08-29 18:10:51 +03:00
c39177bc8d Relay log clear supports multiple slave connections
Now waits for the relay log of the correct slave connection.
2018-08-29 17:07:52 +03:00
85d8a85cde Update master failure detection from slaves
The detection now works with multiple slave connections.
2018-08-29 17:07:52 +03:00
a593d00c65 Simplify failed master detection
No longer depends on monitor events as the other operations do not
either. The active_event/new_event detection was removed, as these
only protect against a rare situation. A similar feature which
protects all the cluster modifications will be implemented later.
2018-08-29 17:04:05 +03:00
9e566bc619 A master that is down with no running slaves can be replaced
This should be a more general way to detect situations where a DBA
or another MaxScale performs a failover.
2018-08-29 16:41:20 +03:00
178d31af27 Fix binlogrouter deadlock on reconnect
The master reconnection in the binlogrouter used the housekeeper
recursively. This is no longer supported and the delayed worker call
mechanism should be used in its stead.
2018-08-29 11:23:00 +03:00
b2047aaa80 Fix heap buffer overflow in blr
The name printing wrote past the end of the buffer.
2018-08-29 11:06:12 +03:00
8b653133a7 Add shutdown detection
The maxscale_is_shutting_down function is used to detect when MaxScale
should stop. This fixes a race condition in the code where the workers has
not yet been initialized but a termination signal has been received. It
also replaces the misuse of the service_should_stop variable with a proper
function.
2018-08-29 11:06:11 +03:00
a29851a42c MXS-2026 Use qc_init(...)/qc_end()
Use qc_init(...)/qc_end() for initializing QC in test-programs.
2018-08-29 09:47:13 +03:00
5c1a1c2700 MXS-2026 Separate QC process and thread initialization
qc_thread_init() must now explicitly be called in every thread
and not just in other threads but the one where qc_process_init()
is called.

This change was caused by QC_INIT_SELF initialization actually
being performed in query_classifier.cc. Before this change, there
actually was a leak in the routing worker running in the main
thread, the query classification cache was created twice.
2018-08-29 09:47:13 +03:00
9a6f1b2044 Merge branch '2.2' into develop 2018-08-28 16:06:23 +03:00
a50e8e9ce6 MXS-2024: Prevent stack overflow
If a large packet is received, the stack would overflow when the username
size was determined from the packet size. The code must not assume
anything about the size of the packet being read.
2018-08-27 20:35:09 +03:00
742ebd0437 Shorten cache tests
Reducint the time the load testing runs for seems to reduce the volume by
the same amount. Given that unit tests are good for catching obvious
mistakes, the test should still be adequate.
2018-08-27 14:02:12 +03:00
f60d1cd6b1 Handle ipv6 mapped ipv4 addresses.
In default case MaxScale uses ipv6 for all addresses also mapping ipv4
connections to ipv6. This caused NamedServerFilter to never match these
addresses to the ones defined in source parameter in ipv4 form.

These ipv6-mapped addresses are now transformed to ipv4 so they can be
checked against source parameter list.
2018-08-26 22:50:25 +03:00
faa65b70f9 MXS-1315 Accept hostnames as source parameters
If there are hostnames as source parameters client hostnames are
attempted to be resolved and checked against saved source hostnames.
2018-08-26 22:50:25 +03:00
1cb96e3152 Cleanup namedserverfilter
Use range-loops when possible and other small cleanup.
2018-08-26 22:50:25 +03:00
f18b6bc28c MXS-1315 Add support for multiple source addresses
Source parameter in NamedServerFilter can now contain a list of source
addresses seperated by comma. This parameter is parsed into a list of ip
addresses and checked against incoming client connections.
2018-08-26 22:50:25 +03:00
421ecdd86b Fix crash caused by wildcards in NamedServeFilter source parameter
Use the formated IP address instead of the one with wildcard symbols.
2018-08-26 22:46:40 +03:00
2c54f28fae MXS-2024: Validate COM_CHANGE_USER packet before use
The use of strcpy on data that is assumed to be null terminated causes
reads and writes past buffers.
2018-08-24 20:52:52 +03:00
91ab59530f Use pending status in external master checks
When the replication status from the external master is checked, the
pending status must be used. This makes sure that the SlaveStatusArray and
the server state are sync.

Also extended the message that was logged when the external master was
lost. By adding the network address there, it makes it easier to see where
the server was replicating from if only the log file is available.
2018-08-23 15:46:45 +03:00
61bb172033 Cleanup failover/switchover
Replication settings warnings are printed once more. Changed some
parameter names to be more consistent within the monitor.
2018-08-23 10:28:47 +03:00
f93578c089 Remove debug.h include in LuaFilter 2018-08-23 10:25:01 +03:00
69722a32ca Fix crash caused by wildcards in NamedServeFilter source parameter
Use the formated IP address instead of the one with wildcard symbols.
2018-08-22 22:46:46 +03:00
4480995089 MXS-1996: Remove misleading errors
The errors are expected if the file is empty.
2018-08-22 14:23:25 +03:00
f2dfd39f79 Clean up JSON diagnostics
Now prints all slave connections.
2018-08-22 12:23:28 +03:00
916b72a733 Clean up loops
Changed many of the iterator loops to range loops.
2018-08-22 12:22:45 +03:00
3777da96bd Miscellaneous cleanup
Removes needless status assignments and unused code. Moves and modifies some comments.
2018-08-22 12:11:33 +03:00
ab9a9f92cb MXS-2020 Remove maxscale/debug.h
- Removed from all files.
- maxbase/assert.h included where necessary.
2018-08-22 11:35:35 +03:00
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
b1e405442f MXS-2020 Replace ss_debug with MXB_AT_DEBUG 2018-08-22 11:34:06 +03:00
24ab3c099c Move top of the file "#pragma once" to after the following comment (swap them). If the comment is a BPL update it to the latest one 2018-08-21 13:13:15 +03:00
03cefcc4ac MXS-2012 Write replication lag to SERVER
Allows routers to read the value.
2018-08-21 11:51:10 +03:00
44a57dbefd Master can be a slave
This is possible if read_only is turned ON on the master and there is
no alternative master to swap to.
2018-08-21 11:51:10 +03:00
1c508cd413 MXS-2012 Read and print Seconds_Behind_Master
Replaces the old replication lag detection.
2018-08-21 11:51:10 +03:00
0d762b2019 MXS-2012 Remove old replication lag detection
The method was quite disruptive as it continuosly wrote to the database.
Also removed the MaxScale ID global, as it wasn't used for anything else.
2018-08-21 11:51:10 +03:00
3576780f78 MXS-2008 Update gateway and tests to initialize maxbase
Update gateway and tests to initialize maxbase using

  maxbase::init();

instead of initializing individual components.
2018-08-21 10:02:39 +03:00
88f1795412 MXS-2008 Move Worker and MessageQueue to maxbase 2018-08-21 10:02:39 +03:00
02ed338afa Remove mxs::Closer<json_t*>
As std::unique_ptr can now be used with a json_t, there's no need for the
closer.
2018-08-20 13:57:00 +03:00
930be8d77a Fix CMake problems in system test
The paths were wrong in the scripts used to run tests. The same problem
was in the CMake files that used CMAKE_SOURCE_DIR instead of
CMAKE_CURRENT_SOURCE_DIR.

Added missing check for BUILD_SYSTEM_TESTS in avrorouter for the
workaround to building without all dependencies present.
2018-08-20 13:56:58 +03:00
d428292ec0 Add workaround to building tests without all dependencies
The system tests can be build even if not all of the dependencies for
MaxScale are met.
2018-08-20 13:56:58 +03:00
40a5ae81c7 MXS-2008 Store worker as MXB_WORKER* and not void* 2018-08-20 11:15:14 +03:00
e0cb11151f MXS-2008 Move maxscale/worker.h to maxbase/worker.h 2018-08-20 11:15:14 +03:00
932956d5f6 MXS-2008 Add maxbase/poll.[h|hh]
Remove maxscale/poll_core.h
2018-08-20 11:15:14 +03:00
8f257a51fe MXS-2008 Remove unused headers from worker.hh
Add corresponding headers to files that depended on those headers.
2018-08-20 11:15:14 +03:00
aaad63ee5e MXS-2008 Move content of maxscale/platform.h to maxbase/cdefs.h
No good reason for keeping that platform adjustments anywhere
else but in cdefs.h.
2018-08-20 11:15:14 +03:00
57334153fe MXS-1880: Fix crash after restart
The offsets in the events were wrong if MaxScale was restarted in the
middle of a binlog. This was caused by the fact that the FDE event
contains information on binlog checksums which is required for a correct
interpretation of the binlog. The FDE event was only read when the binlog
was first opened when it needs to be read every time the binlog is opened.
2018-08-20 08:06:59 +03:00
d6ed10975e MXS-2015: Add missing newlines
The newlines were missing from a few of the avrorouter responses.
2018-08-20 08:06:59 +03:00
1c733bf450 MXS-2015: Always check for error responses
As a JSON object can never start with the ERR prefix, it is safe to check
it for all requests. Also fixed the missing newline in the avrorouter
error message.
2018-08-20 08:06:59 +03:00