11599 Commits

Author SHA1 Message Date
Johan Wikman
5f809e5066 MXS-2011 Store settings from config object
Also store settings of alternative configs as well.
2018-09-04 15:54:21 +03:00
Johan Wikman
dec81594c1 MXS-2011 Assert that configurations are identical
At save time, assert that the configuration as dispersed around
blr and as stored in the config object are identical.

Later its the state from the config object that will be saved.
2018-09-04 15:54:21 +03:00
Johan Wikman
0c3fcfe302 MXS-2011 Allow alternative connections to be specified
Alternative masters can now be specified like

  CHANGE MASTER TO ...
  CHANGE MASTER ":2" TO ...
  CHANGE MASTER ":3" TO ...

Now only the data is stored, but it is neither used nor
saved.
2018-09-04 15:54:21 +03:00
Johan Wikman
93dc75a011 MXS-2011 Introduce blr_file_read_master_config()
One function for writing, another for reading the config.
No code changes; just moving code around.
2018-09-04 15:54:21 +03:00
Johan Wikman
a43f2ce8fb MXS-2011 Store current CHANGE MASTER config in router 2018-09-04 15:54:21 +03:00
Johan Wikman
d036668ffa MXS-2011 Rename blr.h to blr.hh
Now contains C++ elements.
2018-09-04 15:54:21 +03:00
Johan Wikman
ce18d13133 MXS-2011 Pick out the connection name if it is provided
Yet not used for anything.
2018-09-04 15:54:21 +03:00
Johan Wikman
8f1d807f1b MXS-2011 Remove "CHANGE MASTER" when testing
The blr_handle_change_master() will receive the string without
"CHANGE MASTER" when running BLR.
2018-09-04 15:54:21 +03:00
Johan Wikman
1aad1ae7d7 MXS-2011 Introduce blr_apply_change_master()
This function applies a change master config. Currently is
used from blr_handle_change_master(), and subsequently will
be used when BLR switches to an alternative master.
2018-09-04 15:54:21 +03:00
Johan Wikman
8f26e3cbaf MXS-2011 Take ChangeMasterConfig into use 2018-09-04 15:54:21 +03:00
Johan Wikman
2ba0b4dda9 MXS-2011 Declare variables at the point where they are needed
Also change explicit allocation into vector.
2018-09-04 15:54:21 +03:00
Johan Wikman
883a3a6fe1 MXS-2010 Introduce ChangeMasterConfig
This type will be used for storing the configuration
specified with CHANGE MASTER at a point where it has been
verified, to the extent possible, that the provided options
are valid.
2018-09-04 15:54:21 +03:00
Johan Wikman
adb7bb8e8a MXS-2011 Lock router only when needed 2018-09-04 15:54:21 +03:00
Johan Wikman
0e1d2ec1ec MXS-2011 First check, then change
By slightly re-arranging things, we do not need to revert
the situation if some parameters are not acceptable, but
can simply return.
2018-09-04 15:54:21 +03:00
Johan Wikman
41e467d543 MXS-2011 Rename types
In order to make it visible that the types contain C++
members, the following types were renamed:

CHANGE_MASTER_OPTIONS -> ChangeMasterOptions
MASTER_SERVER_CNF -> MasterServerConfig

Functions where also changed to take const refs were appropriate.
2018-09-04 15:54:21 +03:00
Johan Wikman
1d059f26eb MXS-2011 Use std::string in MASTER_SERVER_CFG
Makes things simpler if you do not need to worry about string
lifetime management.
2018-09-04 15:54:21 +03:00
Johan Wikman
0c59516e24 MXS-2011 Do not "free" CONFIG_MASTER_OPTIONS
Its members are std::string, so they do not need to be
explicitly freed.
2018-09-04 15:54:21 +03:00
Johan Wikman
e85c4387c7 MXS-2011 Store CHANGE MASTER options as std::strings
In order support the possiblity for having multiple alternative
masters for the binlog server, we need to have multiple configs
around.

Originally the config values were stored as 'char *':s, which
would have made the lifetime management of the strings laborious
and error prone.

Now, the options are stored as std::string:s, which makes the
lifetime management a non-issue.
2018-09-04 15:54:21 +03:00
Johan Wikman
51fffedf7d MXS-2011 Assume argument values have been dequoted
Functions setting particular values no longer de-quote strings,
but assume the de-quoting already has been made.
2018-09-04 15:54:21 +03:00
Johan Wikman
f946272af1 MXS-2011 Immediately de-quote strings
When receiving a command, such as

    CHANGE MASTER TO MASTER_HOST = '127.0.0.1' ...

when the value is extracted, the quotes are removed before the value
is returned.

Firstly, BLR does not anyway anywhere enforce that quotes are present
where they should be and, secondly, BLR currently does de-quoting all
over the place and with this change, all those places can be simplified.
2018-09-04 15:54:21 +03:00
Markus Mäkelä
19b059d303
Add std::function overload to RoutingWorker::broadcast
This makes it easier to collect distributed results from multiple workers.
2018-09-04 13:04:08 +03:00
Markus Mäkelä
ce7a59fb56
Allow mxs::rworker_local<const T>
By removing the constness of the type for the actual stored value, the
return values of the access operators are defined by the type itself. This
allows both const and non-const types to be stored in a rworker_local
object.
2018-09-04 13:04:08 +03:00
Markus Mäkelä
db1d72fb19
Use mxs::rworker_local in readwritesplit
The configuration updating in readwritesplit was the inspiration for the
mxs::rworker_local type. Due to this, taking it into use simply means that
the type changes from Config to mxs::rworker_local<Config>.
2018-09-04 13:04:08 +03:00
Markus Mäkelä
26dfb19ea4
Make routingworker.hh public
Given that worker.hh was public, it made sense to make routingworker.hh
public as well. This removes the need to include private headers in
modules and allows C++ constructs to be used in C++ code when previously
only the C API was available.
2018-09-04 13:04:08 +03:00
Markus Mäkelä
bd2e23fb85
Add mxs::rworker_local<T> datatype
The mxs::rworker_local<T> is a convenience type that provides fast read
access with thread-safe updates. It is intended to be used with data that
is read often but updated rarely e.g. configuration data for routers.
2018-09-04 13:04:08 +03:00
Esa Korhonen
c03467f9f3 Update MariaDBMonitor documentation
More explanation on master selection and tips on troubleshooting
failover/switchover.
2018-09-04 10:21:27 +03:00
Esa Korhonen
122c63285f Updated changelog, release notes and MariaDB-Monitor documentation 2018-09-04 10:21:27 +03:00
Marko
bb93bcdbfe Add support for ipv6 in NamedServerFilter
NamedServerFilter now uses struct sockaddr_in6 to store the source
parameter. If ipv4 addresses are used they are mapped to ipv6 struct,
this allows the usage of both ipv4 and ipv6.

This commit also includes some small refactoring and removing some code
that was not needed anymore.
2018-09-03 19:31:48 +03:00
Esa Korhonen
763e1395ae Print port with 'enable-statement-logging' 2018-09-03 11:08:33 +03:00
Esa Korhonen
2b42011250 Merge branch '2.2' into develop 2018-09-03 10:48:26 +03:00
Esa Korhonen
79ba89fba1 MXS-2034 Set query_retry_timeout
Was setting query_retry instead.
2018-09-03 10:46:32 +03:00
Markus Mäkelä
77926bb999
Merge branch '2.2' into develop 2018-08-31 12:25:21 +03:00
Markus Mäkelä
b2fea99dbc
Fix set_env.sh
The -gt operator should be used to compared numbers.
2018-08-31 12:12:11 +03:00
Markus Mäkelä
0afcfd7719
Link maxbase tests against rt
The logging requires it.
2018-08-31 09:32:07 +03:00
Esa Korhonen
7cd1cfdb80 Relay log waiting is part of failover_prepare
Since the servers are not modified before or during the wait, the waiting
can be done in the preparation method. This simplifies the actual failover
somewhat, and allows the monitor to keep running normally while waiting for
the log to clear.
2018-08-30 17:07:34 +03:00
Johan Wikman
32c4e60516 Do not re-initialize the log
Do not re-initialize the log without it having been finished
in between.
2018-08-30 15:03:06 +03:00
Timofey Turenko
19a84569fe add compatibility with one Maxscale template to set_env.sh 2018-08-30 14:26:19 +03:00
Markus Mäkelä
a13e95951b
Merge branch '2.2' into develop 2018-08-30 11:37:49 +03:00
Esa Korhonen
9c3dc76fa9 Add format attribute to mxs_json_error_append 2018-08-30 10:57:27 +03:00
Markus Mäkelä
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
Markus Mäkelä
c554fd3417
Fix mxs1643_extra_events
The test expected the wrong results. Also updated the log message checks
to be server specific.
2018-08-29 18:36:34 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
e4fdaf0c50
MXS-1735: Clarify SSL documentation
Explicitly state that servers only require `ssl_ca_cert` and that
`ssl_cert` and `ssl_key` are optional in certain cases. Updated the
wording of all parameters and removed obsolete or false documentation.
2018-08-29 18:10:51 +03:00
Esa Korhonen
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
Esa Korhonen
85d8a85cde Update master failure detection from slaves
The detection now works with multiple slave connections.
2018-08-29 17:07:52 +03:00
Esa Korhonen
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
Esa Korhonen
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
Timofey Turenko
39016c410c use different hostname for second Maxscale VM 2018-08-29 12:00:52 +03:00
Timofey Turenko
4fd6d075cb doc and astyle fixes 2018-08-29 12:00:52 +03:00