988 Commits

Author SHA1 Message Date
Johan Wikman
d0153f6ce3 clustrixmonitor: Add missing include 2019-05-21 12:50:10 +03:00
Esa Korhonen
cf46004bd8 Make the servers-array in Monitor private
This prevents derived classes from modifying the array directly,
which would be unsafe.
2019-05-21 10:58:24 +03:00
Esa Korhonen
650230455a MXS-2169 Allow unsafe failover when 'enforce_simple_topology' is on
If gtid of master is unknown (as is typical when master is down when MaxScale
starts) the domain id is guessed from the slaves instead. This is usually
safe.
2019-05-20 10:43:54 +03:00
Esa Korhonen
4ee30f5c52 MXS-2169 Allow a downed server to be selected as topology master
This is required for the case when MaxScale is started when the master is
already down.
2019-05-17 13:46:33 +03:00
Esa Korhonen
d2f3e56d0a MXS-2169 Add 'enforce_simple_topology'-setting
Does not add any functionality yet.
2019-05-17 13:46:33 +03:00
Esa Korhonen
c801789ff3 Cleanup monitor running state 2019-05-17 13:34:48 +03:00
Esa Korhonen
08b4c26652 Monitor types and fields cleanup
Moves some enums to class enums. Moves some free functions to class methods.
2019-05-17 13:34:48 +03:00
Esa Korhonen
476dc80bc9 Move settings shared between MariaDBMonitor and MariaDBServer to container
Removes the need to communicate these settings via call parameters.
2019-05-10 14:48:41 +03:00
Esa Korhonen
d10c7a4140 Rearrange MariaDB-Monitor settings variables
Moves some of the settings to a dedicated container to separate them
from other fields.
2019-05-10 14:48:41 +03:00
Esa Korhonen
a9b1e3a442 Move some Monitor fields to private and protected
None of the fields should be publicly writable and some should not even
be writable from derived classes.
2019-05-10 14:48:41 +03:00
Markus Mäkelä
418ccf861d
Format routers and monitors 2019-05-10 10:31:12 +03:00
Johan Wikman
381940ce8c Merge branch '2.3' into develop 2019-05-09 14:35:44 +03:00
Markus Mäkelä
567ad9b8b8
Fix galeramon regression
The comparisons were wrong: strcasecmp returns 0 for equal strings.
2019-05-09 12:30:29 +03:00
Johan Wikman
d3a1f5c51f MXS-2463 Prefer range loops
Also consistently use 'kv' as in key-value as the element name
when the collection looped over is a map.
2019-05-07 10:36:21 +03:00
Johan Wikman
4cf29bea36 MXS-2463 Rename m_nodes to m_nodes_by_id
Makes it obvious it is a map.
2019-05-07 10:36:21 +03:00
Johan Wikman
3c9ad0e452 MXS-2463 Ignore persisted data if bootstraps have changed
If there have been any changes in the bootstrap servers specified
for the Clustrix monitor, then the persistent connection information
is not used.

Otherwise, if the bootstrap server is changed and inaccessible, we
may connect to another cluster than the intended one.
2019-05-07 10:36:21 +03:00
Johan Wikman
ff33453e1a MXS-2463 Prepare for another set of queries
Persisted information about dynamic nodes must be used only if
the bootrap information has not been changed, as otherwise we risk
using information that is not valid.
2019-05-07 10:36:21 +03:00
Johan Wikman
6f607e13de MXS-2446 Do not assume created server exists
"Once you eliminate the impossible, whatever remains, no matter
 how improbable, must be the truth." Arthur Conan Doyle

Since server objects are never destroyed, currently the only
explanation for the crash described in MXS-2446 is that a server
created at runtime could not, immediately after the creation, be
found using its name.
2019-05-06 12:13:29 +03:00
Johan Wikman
86b099b487 MXS-2468 When the URLs change, HTTP GET must be cancelled
If the nodes change while a multi HTTP GET is in process, the
corresponding delayed called must be cancelled. Otherwise we
eventually would end up attempting to update the state of the
nodes using the wrong result.
2019-05-03 15:00:00 +03:00
Johan Wikman
3d420dee6f MXS-2329 Use durations in MariaDB monitor 2019-04-30 13:02:53 +03:00
Esa Korhonen
643514bbe4 Merge branch '2.3' into develop 2019-04-30 12:46:07 +03:00
Andreas Krüger
7a5f11b752 Fix wrong check for wsrep_ready
wsrep_ready was check for ON/YES/1/true, but it has to be checked for OFF/NO/0/false as we are removing nodes, not joining.
2019-04-25 07:45:09 +03:00
Andreas Kruger
9f7a7e473e Enable galeramon to track wsrep_desync, wsrep_ready, wsrep_sst_donor_rejects_queries and wsrep_reject_queries 2019-04-25 07:45:09 +03:00
Markus Mäkelä
1e84742cbb
Remove ndbclustermon 2019-04-24 14:02:18 +03:00
Esa Korhonen
75c0ac5323 Move items from MonitorWorker to MonitorWorkerSimple
MonitorWorker only enforces the use of a worker thread but otherwise
does not define how the monitor is implemented.
2019-04-24 11:27:11 +03:00
Markus Mäkelä
4186f39616
Merge branch '2.3' into develop 2019-04-23 12:11:09 +03:00
Markus Mäkelä
60c1b15d60
MXS-2441: Add slave support to galeramon
Slaves that replicate from galeramon now get the Slave status if they are
replicating from a joined Galera node.
2019-04-23 11:57:10 +03:00
Markus Mäkelä
a471417150
MXS-1922: Show GTIDs for Galera nodes
Galera generates GTIDs even if they are unique across all nodes and it
makes sense to display this.
2019-04-18 12:04:56 +03:00
Markus Mäkelä
a4c6f3542a
MXS-2315: Tokenized CS version extraction
The STL regex implementations have proven to be unreliable on older
systems and replacing the regex with hand-written code for version
extraction is less prone to break.
2019-04-17 11:17:33 +03:00
Esa Korhonen
067660e3e7 Merge branch '2.3' into develop 2019-04-16 16:55:12 +03:00
Esa Korhonen
2ca9337da1 Merge branch '2.2' into 2.3 2019-04-16 16:34:57 +03:00
Johan Wikman
8b29e70f63 MXS-2428 Allow fixed Clustrix configuration
If 'dynamic_node_detection' has been set to false, then the
Clustrix monitor will not dynamically figure out what nodes are
available, but instead use the bootstrap nodes as such.

With 'dynamic_node_detection' being false, the Clustrix monitor
will do no cluster checks, but simply ping the health port of
each server.
2019-04-16 13:58:27 +03:00
Johan Wikman
e09a6c8100 MXS-2428 Add 'dynamic_node_detection' 'health_check_port'
'dynamic_node_detection' specifies whether the Clustrix monitor
should dynamically figure out what nodes there are, or just rely
upon static information.

'health_check_port' specifies the port to be used when perforing
the health check ping.
2019-04-16 13:58:27 +03:00
Esa Korhonen
5ba305c2c1 MXS-2426 Do not permanently disable automatic cluster operations when they fail
Only disabled for "failcount" monitor ticks. Also turns some related log
messages to notices.
2019-04-16 11:26:34 +03:00
Esa Korhonen
3c188bf421 Merge branch '2.3' into develop 2019-04-16 11:23:49 +03:00
Esa Korhonen
f8a22d0ac0 MXS-2344 Add setting for enabling SSL for replication
If the monitor setting "replication_master_ssl" is set to on, any CHANGE MASTER TO-command
will have MASTER_SSL=1. If set to off or unset, MASTER_SSL is left unchanged to match existing
behaviour.
2019-04-15 19:15:45 +03:00
Johan Wikman
893059c537 MXS-2424 Use persisted nodes if bootstrap node missing
At runtime the Clustrix monitor will save to an sqlite3
database information about detected nodes and delete that
information if a node disappears.

At startup, if the monitor fails to connect to a bootstrap
node, it will try to connect any of the persisted nodes and
start from there.

This means that in general it is sufficient if the Clustrix
monitor at the very first startup can connect to a bootstrap
node; thereafter it will get by even if the bootstrap node
would disappear for good.
2019-04-12 16:29:21 +03:00
Johan Wikman
164ca7b5f1 MXS-2424 Stop passing redundant information around
mysql_get_host_info(MYSQL*) returns enough information to identify
the connection.
2019-04-12 16:29:21 +03:00
Johan Wikman
c422aafe1d MXS-2424 Refactor for further changes
In subsequent change(s) persisted node information will be used
as a last resort to connect to a Clustrix node.
2019-04-12 16:29:21 +03:00
Johan Wikman
875146f53c MXS-2424 Store information about dynamic Clustrix nodes
Information about the detected Clustrix nodes is now stored to
a Clustrix monitor specific sqlite-database. This will be used
for bootstrapping the Clustrix monitor, in case a statically
defined bootstrap server is unavailable.
2019-04-12 16:29:21 +03:00
Esa Korhonen
d89f0c062b MXS-2271 Change Monitor->m_name to std::string
Also, monitor address is no longer printed.
2019-04-02 13:08:38 +03:00
Johan Wikman
84bf241dd1 MXS-2339 A running Clustrix node is regarded as master
In this context master should be interpreted as "can be read
and written to".

Marking them as master requires less changes in RWS to make it
usable with a Clustrix cluster.
2019-04-02 08:13:50 +03:00
Markus Mäkelä
6bc2c54081
Merge commit 'a78f0fbe2537542dc7f3f0dd8b19b93ac8d9d7f8' into develop 2019-03-28 13:53:40 +02:00
Markus Mäkelä
858327acf7
Rename Being Drained to Draining
With this, the words are unique and can be searched for more easily. This
does not fix the test failure of mxs2273_being_drained.
2019-03-28 13:21:24 +02:00
Markus Mäkelä
74c888316e
Fix csmon version check
The version check still assumed that 1.1.7 has the required functionality.
2019-03-25 18:48:26 +02:00
Johan Wikman
bf5f80b13b Fix ClustrixMonitor
The cluster check can only be made after the monitor has been
started. If done when monitor is configured it will at startup
be done when services are not yet available and hence they will
not be populated with the dynamically discovered servers.
2019-03-25 13:56:39 +02:00
Esa Korhonen
4c6306e363 Merge commit '5cdba97ec7ee7f1ef74249b952774adf1b111464' into develop 2019-03-22 13:25:58 +02:00
Esa Korhonen
5cdba97ec7 Merge commit '216eb904c557509ea5a3216e68e274df957ab807' into 2.3 2019-03-22 10:48:31 +02:00
Markus Mäkelä
203bba0e1d
Add support for multiple runtime error messages
Storing all the runtime errors makes it possible to return all of them
them via the REST API. MaxAdmin will still only show the latest error but
MaxCtrl will now show all errors if more than one error occurs.
2019-03-21 18:19:10 +02:00
Esa Korhonen
216eb904c5 MXS-1991 Allow replication_user and replication_password be set runtime
Because runtime changes are performed one at a time, adding replication credentials
to a mariadbmon which didn't have any would cause an error to be printed, and
the monitor would not start.

This is now fixed by allowing replication_user without replication_password. This
is not an ideal solution as a configuration file with only replication_user would be
accepted. Also, when adding the credentials to a monitor, replication_user must be
given first to avoid the error.
2019-03-21 17:06:24 +02:00