Commit Graph

11589 Commits

Author SHA1 Message Date
d9ddf0f720 Reinstate implicit log initialization
As some of the functionality depends on the log being default initialized
in the case an error occurs, the code needed to be reinstated.
2018-08-29 11:06:12 +03:00
9adc08a686 Move log initialization into a function
This will be of help when the implicit log initialization is added back.
2018-08-29 11:06:11 +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
8f3eabb868 Add missing timeouts to mxs1929_start_from_scratch 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
ce715e03aa MXS-2026 Make QC default initialization simpler
In test-programs and alike, QC can now be initialized with
one function instead of three.
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
51ade9e6fe Wait two monitor intervals in failover tests
Since the failover always takes two intervals, the test also needs to wait
two intervals.
2018-08-28 08:39:38 +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
2f7ed85b3f MXS-2026 Keep COM_QUERY and COM_STMT_PREPARE separate 2018-08-27 14:21:34 +03:00
cb6096f84d Provide std::default_delete<GWBUF*>
Now GWBUFs can be placed in std::unique_ptr:s.
2018-08-27 14:20:36 +03:00
25c0d3da14 Always treat unloadable modules as an error
When the loading of a module fails, be it due to a typo or a problem in
the library, the configuration is labeled as invalid.
2018-08-27 14:03:39 +03:00
c92aa02961 Don't use log before initialization
The print_log_n_stderr function used to implicitly initialize the log
manager. As this is no longer done, no logging must be done before the log
manager is initialized.
2018-08-27 14:03:39 +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
68b4f20436 Split schema and row processing
The recursive calls into `read` caused unnecessary slowness in the
connection phase. The actual first row should only be read when the data
is requested. This can possibly solve the false timeout errors caused by
slow sending of the first row of data.
2018-08-27 13:41:20 +03:00
69f53f886d Append received data to CDC::TIMEOUT errors
The extra output of received data should be added only to timeout errors,
not to all errors.
2018-08-27 12:31:02 +03:00
01e1c616ba Fix CDC error detection
The error detection assumed the buffer was null-terminated which was never
guaranteed.
2018-08-27 12:11:42 +03:00
02a65f311a Fix memory leak in cdc-connector
The Closer default value was wrong.
2018-08-27 12:00:28 +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
4a637b024d Fix mysqlmon_failover_no_slaves
The current monitor detects the extra slave connection before
failover is launched, turning the entire feature off. That part of
the test has been removed.
2018-08-24 12:08:22 +03:00
13c7072da1 Separate CCRFFilter hints section from the main overview
The text changed subjects rather abruptly. Having the hint part of it
gives some context and appears to make the text flow nicer.
2018-08-23 23:52:42 +03:00
8cfc966561 MXS-1929: Update unit tests with monitor changes
The user is a mandatory parameter and needs to be passed when a monitor is
created.
2018-08-23 15:46:47 +03:00
1f8ed106b3 MXS-1929: Test configuration creation under load
The test case performs the creation and destruction of a complete MaxScale
configuration and repeats the process multiple times.
2018-08-23 15:46:47 +03:00
3eb7072972 MXS-1929: Improve runtime monitor creation
The monitor JSON is now more closely inspected before the actual monitor
is allocated. This prevents creation of monitors without credentials which
was previously possible.

The monitor alteration was also changed to stop and start the monitor only
once instead of stopping and starting after each parameter
modification. This prevents multi-parameter updates from failing due to
monitors seeing a partial set of the new values. Currently only the
`replication_user` and `replication_password` parameters could cause this.
2018-08-23 15:46:47 +03:00
fe124b79cc MXS-1929: Fix state of services created at runtime
If a service was created at runtime, it would be in the Allocated state
until it was stopped. The serviceStart function isn't necessary from a
functional point of view (a new service cannot have listeners that need
starting) but it does set the correct state and it's the "right" thing to
do.
2018-08-23 15:46:46 +03:00
befb25a14a MXS-1929: Add parameters to maxctrl create monitor
The parameters for the monitor can now be defined when the monitor is
created. This makes the filter, monitor and service creation consistent.
2018-08-23 15:46:46 +03:00
065ee50d53 MXS-1929: Start monitors after creation
Monitors created via the REST API that were started and configured
successfully should also be started. This removes the extra step of
starting the monitor after creating it.
2018-08-23 15:46:46 +03:00
a6bef0a80d Add credentials for remove REST API calls
The base URL and credentials used for REST API calls can now be defined in
the [maxscale] section. This allows encrypted passwords to be used.
2018-08-23 15:46:46 +03:00
fe7d7475a4 Improve PID file check
The executable name of the PID is now checked to be maxscale. This fixes
the problem where MaxScale would refuse to start if a stale PID file had a
PID of a process that's not a MaxScale process.
2018-08-23 15:46:46 +03:00
518a4ef3bd Update release notes
Added query classifier cache and moved ssl changes to the correct section.
2018-08-23 15:46:46 +03:00
ad36a50e97 Remove log initialization form print_log_n_stderr
The log manager must not be initialized twice. If an error is to be logged
to a file, the log manager has already been initialized.
2018-08-23 15:46:46 +03:00
1692765503 Enable query classifier cache by default
Enabling it will give a performance improvement and it offloads work from
the CPU. This leads to better and more complete utilization of system
resources.
2018-08-23 15:46:45 +03:00
13c04324cf Add master extraction via REST API
The master server of a monitor can now be extracted with the
mon_get_external_master function. It uses the REST API to find a master
server in the set of servers monitored by a monitor.
2018-08-23 15:46:45 +03:00
934600f8fc Add minimal HTTP GET test
The test does a request and prints the responses. It is done to see that
the functionality works. Also added a timeout of 10 seconds to both the
connection and data transfer phases.
2018-08-23 15:46:45 +03:00
f8fb9510c9 Add HTTP GET function
The function performs a HTTP GET on a URL and returns the HTTP response.
2018-08-23 15:46:45 +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
9799cfdb2b MXS-1735: Clarify differences between MaxScale and server
The server allows both unencrypted and encrypted connections on the same
port. MaxScale only allows either encrypted or unencrypted
connections. The differences as well as the reasoning for this need to be
documented.
2018-08-23 09:32:20 +03:00
75c298f63c MXS-2011 Make listener_set_ssl_version() const correct 2018-08-23 09:24:46 +03:00
8e7b012852 Don't call some of atexit functions twice
Registering of atexit functions was fixed so these functions don't need
to be called here anymore.
2018-08-22 22:51:32 +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
7e3f5a03b6 Add a default value for BUILD_SYSTEM_TESTS
Adding a default value makes it visible in the CMake configuration GUI.
2018-08-22 16:43:17 +03:00
5485f83e75 MXS-1929: Always store the module name parameter
Services, monitors and filters all use the parameters for object
serialization. This means that when the object is created, the module
parameter must be in the parameter list.
2018-08-22 16:43:17 +03:00