11064 Commits

Author SHA1 Message Date
Esa Korhonen
b421e56d1c Move execute_worker_task to MonitorInstance
The function is rather general and may of use to other monitor modules.
2018-07-24 15:07:18 +03:00
Esa Korhonen
27084f1368 Handle the situation where the previous master is reselected 2018-07-23 12:17:00 +03:00
Esa Korhonen
f8898a1562 Update MariaDB-Monitor documentation
Added explanation on master selection.
2018-07-20 17:44:26 +03:00
Esa Korhonen
382a017518 A master which is down for longer than failcount is considered an invalid master
If auto_failover is disabled and an alternative master exists, the
monitor will swap the master. This may break replication, but the
situation requires that the dba has set up a cluster with multiple
masters.
2018-07-20 15:47:23 +03:00
Esa Korhonen
c9570ff616 Check failover applicability to the cluster every turn
This should give an advance warning if a user tries to activate auto_failover
on a cluster which does not support it.
2018-07-20 15:33:47 +03:00
Esa Korhonen
862ae099b0 Construct diagnostics results in the monitor thread
MariaDBMonitor diagnostics printing is unsafe as some of the read
fields are arrays. To be on the safe side, the fields are now read
in the monitor worker thread.

Since diagnostics must work even for stopped monitors, a worker task
is used. In practice, it usually runs when the monitor is sleeping.
2018-07-20 10:18:58 +03:00
Esa Korhonen
590df89dbc Fix mm_mysqlmon test
Because of monitor changes, the test had wrong assumptions.
Renamed the test and updated it to use MaxCtrl for some queries.

Also, changed the type of the cycle container in the monitor to an
ordered map so that results are predictable.
2018-07-18 16:32:16 +03:00
Markus Mäkelä
d91710c640
Remove unused DCB state
The state was never assigned.
2018-07-18 15:47:25 +03:00
Markus Mäkelä
d9fde54b95
Use mxs::SpinLock in config_runtime.cc
The C++ version with the lock guard is easier to manage when there are
multiple return points from a function. It also makes sure that the lock
is freed after it's used.
2018-07-17 11:52:37 +03:00
Markus Mäkelä
c31e78754d
Fix object name tokenization
Spaces must be considered a part of the object name in tokenization. This
ensures that the name normalization process generates correct names and
that tokens are split at correct places.
2018-07-17 11:52:23 +03:00
Markus Mäkelä
4da7e4678f
Improve protocol level result collection
The result collection now covers more cases, including the use of
COM_CHANGE_USER. The addition of COM_STMT_EXECUTE to the list of commands
that generate result set responses is needed in order for the code to take
the correct branch.
2018-07-17 11:52:23 +03:00
Markus Mäkelä
28609a2c77
Remove session command processing from mariadbbackend
With the removal of the old session command implementation, the code that
used it can be removed or replaced with newer constructs. As a result, the
backend protocol no longer does any session command processing.

The three buffer types, GWBUF_TYPE_SESCMD_RESPONSE,
GWBUF_TYPE_RESPONSE_END and GWBUF_TYPE_SESCMD as well as their related
macros are no longer used and can be removed.
2018-07-17 11:52:22 +03:00
Markus Mäkelä
19feee9e0e
Remove old session command implementation
The old implementation was largely. Also removed some unused macros from
the header.
2018-07-17 11:52:22 +03:00
Markus Mäkelä
728a3f6957
Clean up filter usage in services
Using a stack-allocated vector allows the filter definition array to only
be allocated once all filters have been successfully processed.
2018-07-17 11:52:22 +03:00
Markus Mäkelä
16aece6f83
Clean up new service configuration
Removed redundant checks and dead code, replaced manual server searches
with correct ones.
2018-07-17 11:52:22 +03:00
Markus Mäkelä
70848e9d6f
Update 2.3 release notes
Added SSL changes and new readwritesplit features.
2018-07-17 11:52:21 +03:00
Markus Mäkelä
437a0b92d2
Update ReadWriteSplit documentation
router_options are removed and thus do not need to be explained.
2018-07-17 11:52:21 +03:00
Markus Mäkelä
788060a905
Update TLS/SSL documentation
Updated and clarified the TLS/SSL parameter documentation.
2018-07-17 11:52:21 +03:00
Markus Mäkelä
4e8ac8dd4f
Fix explicit server allocation
The test cases allocated servers in a way that doesn't comfortably suit
the way the servers are now allocated. Adding a helper C++ class to load
module defaults makes it easier to do explicit server initialization in
tests.

The binlogrouter was also fixed in this commit as it uses servers much
like a test would use.
2018-07-17 11:52:21 +03:00
Markus Mäkelä
df94ef990c
Use module-type parameters for servers
The server base objects now use the module-type parameters for generic
configuration.
2018-07-17 11:52:20 +03:00
Markus Mäkelä
d28b1c9d1d
Validate SSL parameters via the module-type parameters
The configuration system that modules use allows the SSL parameter
validation to be simplified. It should also provide more consistent error
messages for similar types of errors.

The SSL_LISTENER initialization is now done in one step. There was no good
reason to do it in two separate steps for listeners but in one step for
servers.

The `ssl` parameter now also accepts boolean values. As the parameter
behaves like a boolean and looks like a boolean, it ought to be a
boolean. It still accepts the custom `required` and `disabled` values
simply for backwards compatibility.

Also added the missing freeing functions for the SSL_LISTENER type. This
prevents failed SSL_LISTENER creations from leaking memory.
2018-07-17 11:52:20 +03:00
Markus Mäkelä
1b89c077b1
Ignore dupicate databases in mxs1849_table_sharding
The test environment isn't always pristine after a test run so for the
sake of being able to actually test what we're attempting to test, we
should ignore duplicate databases for the time being.

The long-term fix is detect when a test doesn't clean up after itself.
2018-07-17 11:52:20 +03:00
Markus Mäkelä
e0361e335f
Fix relay master assignment
The relay master status was assigned to a server based on the last known
replication status of the slaves that have at some point replicated from
it. This can cause false positives and the relay master status is assigned
to servers that have never been observed to act as relay masters.
2018-07-17 11:52:20 +03:00
Markus Mäkelä
c7f6755949
Update merged test configurations
The passwd parameter caused problems now that it has been removed.
2018-07-17 11:52:19 +03:00
Markus Mäkelä
0750e93eeb
Fix verify_master_failure
The master failure verification would not work if the slaves did not have
a state change since MaxScale had started. This can be fixed by treating
the startup of MaxScale as an event of sorts.
2018-07-17 11:52:19 +03:00
Markus Mäkelä
177f7357e0
Use module-style parameters with filters
Filters now use the module-style parameters to automate the type checking
and default value assignment.
2018-07-17 11:52:19 +03:00
Markus Mäkelä
ddaf300783
Fix and improve configuration validation
The parameter type and value validation is now fully done for the base
module parameters as well. This fixes a problem that was introduced when
the listeners were moved to the module parameter system where the
`service` parameter values weren't fixed for the new naming style.

Added an explicit check for the module type that catches errors in the
type parameter. The lack of this parameter prevents the proper detection
of other parameters.

Also cleaned up and/or removed redundant sections of code. By treating
reserved parameters the same way as module declared ones, the same code
can be re-used for all types.
2018-07-17 11:52:18 +03:00
Markus Mäkelä
421282421c
Use module-style parameters with listeners
Listeners now use the module-style parameters to automate the type
checking and default value assignment.
2018-07-17 11:52:18 +03:00
Markus Mäkelä
0808f66aaa
Update older mysqlmon tests
Some of the older tests expected results that didn't make much sense. The
mxs1643_extra_events test should expect the master to devolve into the
Running state when it is set into read-only. This is understandable as a
set of servers consisting only of slaves is rather disorienting.

In mxs1678_relay_master breaking the replication of the relay master
devolves it into the Running state as well as all slaves replicating from
it. This is a better result as in a real-life scenario only the valid and
up-to-date slaves would be used.
2018-07-17 11:52:18 +03:00
Markus Mäkelä
bded99aea3
Assign slave status even if no master is available
The master validity check now checks if the master is down. This requires
that the slave status is assigned even if no master is available.

The failover precondition is also fulfilled as long as one valid promotion
candidate is found. Previously a slave that didn't use GTID replication
appeared to prevent failover.
2018-07-17 11:52:18 +03:00
Markus Mäkelä
e80a145b2c
Remove passwd from bundled configurations
The configurations still used the old parameter name.
2018-07-17 11:52:17 +03:00
Markus Mäkelä
def8cb5071
Add C++ helper for SSH output
The ssh_output function returns a string and takes a std::string as the
ssh command parameter.
2018-07-17 11:52:17 +03:00
Markus Mäkelä
4bf6233d2a
Drop created tables in tests
If a table is created in a test, it should also drop the table.
2018-07-17 11:52:17 +03:00
Markus Mäkelä
12b4f67f30
Skip mxs421_events if syslog doesn't log to file
The test cannot work unless syslog writes to a file.
2018-07-17 11:52:17 +03:00
Markus Mäkelä
3078da3992
Make use of router_options in readwritesplit an error
As the router_options have been deprecated in 2.2 and removed in 2.3,
using them in readwritesplit is an error.
2018-07-17 11:52:16 +03:00
Markus Mäkelä
e963f4e82b
Fix reading of past-the-end memory
The buffer that binlogrouter allocated for the error message was too
small. ASAN happened to catch this.
2018-07-17 11:52:16 +03:00
Markus Mäkelä
4162116109
Remove router_options from readwritesplit tests
The router_options parameter is no longer accepted by readwritesplit.
2018-07-17 11:52:16 +03:00
Markus Mäkelä
5fdf82a508
Only warn about whitespace in section names
The warnings were logged even when the fix_section_name function was used
to fix non-section names.
2018-07-17 11:52:15 +03:00
Markus Mäkelä
fa6bcefdb0
Remove unused file
The doxygen.c file was not used nor updated.
2018-07-17 11:52:15 +03:00
Markus Mäkelä
4a0ace2a72
Use module-style parameters with monitors
The common monitor parameters are now stored as module-style
parameters. This makes the error reporting as well as the type checks for
the parameters consistent with parameters declared by the modules.
2018-07-17 11:52:15 +03:00
Markus Mäkelä
dd8402dd94
Update binlogrouter test configurations
Updated the binlogrouter test configurations to use correct options. Also
removed commented out sections and obsolete configurations.
2018-07-17 11:52:15 +03:00
Markus Mäkelä
d51a21faf7
Remove passwd from test configurations
As the parameter will be removed in 2.3, the test configurations need to
be updated.
2018-07-17 11:52:14 +03:00
Markus Mäkelä
f807c21242
Treat service parameters as module parameters
The same mechanism that is used for modules can be used for the
configuration of the core objects. This removes the need for the redundant
code that validates various values that is already present in the code
that modules use.
2018-07-17 11:52:14 +03:00
Esa Korhonen
f2e0bf3caa Factor out functions
The topology update is now in a method. Also, the m_master-field
is only written inside a method so that the cycle info is always
updated.
2018-07-16 15:58:16 +03:00
Esa Korhonen
936bcde135 Remove old "detect_standalone_master"-feature, update documentation
The auto_failover is a more reliable solution and should be used instead. Several
unused parameters were removed, although they can still be defined in the config
file. Updated documentation on the relevant parts.
2018-07-16 15:58:16 +03:00
Esa Korhonen
f7538db3b7 Fix release-mode compile error
Caused by merging 2.2.
2018-07-16 15:40:08 +03:00
Markus Mäkelä
1811503a13
Merge branch '2.2' into develop 2018-07-15 21:22:27 +03:00
Markus Mäkelä
19a349a4a8
MXS-1976: Explain shutdown service behavior
The process of stopping a service will not prevent new connections from
being created. The documentation needs to be extended so that the meaning
of `accepted` is explicitly and clearly stated.
2018-07-15 21:04:03 +03:00
Marko
2acf5f545e MXS-1066 Add query hint to route to last used server
Add new hint type and support for it in the readwritesplit router.
2018-07-13 11:11:02 +03:00
Markus Mäkelä
e2fb0093b1
Merge branch '2.2' into develop 2018-07-12 19:38:40 +03:00