Commit Graph

12646 Commits

Author SHA1 Message Date
b582119d27 MXS-2275 Check for softfailed nodes
When checking the node info, also include information about wheter
a node is being SOFTFAILed. If it is, turn on the `Being Drained`
bit.

A node is SOFTFAILed with the intention of removing it, so better
not to create new connections to it as they later would be broken
when the node is actually taken down.
2019-02-01 11:00:53 +02:00
55b1e031d6 MXS-2275 Fix breakage due to rebasing 2019-02-01 11:00:53 +02:00
6d60714a17 MXS-2275 Always log monitor instance name
When logging something, always log the monitor instance name
as well.
2019-02-01 11:00:53 +02:00
cb07687672 MXS-2275 Implement [un]softfailing
It is now possible to [un]softfail a Clustrix node via MaxScale
using a Clustrix monitor module command.

In case a node is successfully softfailed, the `Being Drained` bit
will automatically turned on. Similarly, if a node is successfully
unsoftfailed, the `Being Drained` bit will be cleared.
2019-02-01 11:00:53 +02:00
2e395c4477 MXS-2275 Add skeleton softfail/unsoftfail support
Add skeleton implementation for the functionality for being able
to softfail and unsoftfail a Clustrix node.
2019-02-01 11:00:53 +02:00
f2d2202ea3 MXS-2304 Use get_enum() instead of config_get_enum() 2019-02-01 10:29:24 +02:00
c8a84cebd0 MXS-2304 Use get_integer() instead of config_get_integer() 2019-01-31 18:12:25 +02:00
63b5eab89e MXS-2304 Convert configuration management structs to classes
The fields of MXS_CONFIG_PARAMETER remain unchanged so that parameter
processing can be changed gradually.
2019-01-31 17:57:16 +02:00
03411e825d MXS-2271 Move journal_max_age inside settings container 2019-01-31 17:05:35 +02:00
ce9b49d8d5 MXS-2271 Move script-related settings to the settings-container
Also moves related functions to class methods.
2019-01-31 17:05:34 +02:00
0903648542 MXS-2271 Move connection settings inside settings struct
Since the settings are now protected fields, all related functions were
moved inside the monitor class. mon_ping_or_connect_to_db() is now a method
of MXS_MONITORED_SERVER. The connection settings class is defined inside the
server since that is the class actually using the settings.
2019-01-31 17:00:47 +02:00
4ee0e9364e MXB_MODULE_NAME must be defined before maxbase/log.h is included
Otherwise MXB_MODULE_NAME will be NULL.
2019-01-31 15:23:32 +02:00
b18467e17e Add direct mode to Worker::execute()
Sometimes that's what you want, but primarily for completeness'
sake and it makes AUTO more sensical as it essentially chooses
beteen DIRECT and QUEUED mode.
2019-01-31 10:04:55 +02:00
556ea552aa MXS-2273 Add system test 2019-01-30 13:04:32 +02:00
8204b7d875 MXS-2273 Fix issues related to changes in Monitor 2019-01-30 12:38:36 +02:00
b650dd4f67 MXS-2273 Drop unnecessary SERVER prefix in names
MXS_MONITORED_SERVER provides enough scope.
2019-01-30 12:16:57 +02:00
bc4a52acb0 MXS-2273 Set SERVER_BEING_DRAINED properly
The maintenance and being-drained modes are now set using the same
mechanism.
2019-01-30 12:16:57 +02:00
e3d74bd18d MXS-2273 Generalise names
The maintenance flag and being-drain flags will be turned on using
the same variable, so the variable and constant names needs to be
generalized.
2019-01-30 12:16:57 +02:00
159d9ccba9 MXS-2273 Move constants to more appropriate locations
Constants now used in the context of MXS_MONITORED_SERVER or
Monitor are now moved from SERVER to MXS_MONITORED_SERVER or
Monitor, respectively.
2019-01-30 12:16:57 +02:00
57a94b417d MXS-2273 Move maint_request from SERVER to MXS_MONITORED_SERVER
The _request_ for setting the status of a server relates to the
monitor and its MXS_MONITORED_SERVER, not to the SERVER itself.
2019-01-30 12:16:57 +02:00
727d3feb3b MXS-2273 Move code for setting maintenance bit to monitor.cc
Applies to being-drained as well.

Better that this special handling is handled by Monitor that needs it.
2019-01-30 12:16:57 +02:00
05b650ed91 MXS-2273 Update release notes regarding draining
TODO: This much explanation in the release notes is a bit too
much, the beef should be moved somewhere else and the release
notes simply refer to that.
2019-01-30 12:16:57 +02:00
8e59f4efbd MXS-2273 A master is a master even if it is not connectible
When looking for a master, if it does exist it should be found
even if it is not connectible. The fact that it is not connectible
should be dealt with when a connection is created.
2019-01-30 12:16:57 +02:00
117f89a409 MXS-2273 Deal with master being drained at RWS connect
If a master is found but it is being drained, the connection attempt
is rejected if the master failure mode is fail_instantly.

In that case the logged message makes it plain that it is the draining
that is the reason for the connection attempt to fail.
2019-01-30 12:16:57 +02:00
0e92affcc3 MXS-2273 Honour BEING_DRAINED in Backend::can_connect()
This will cause the drain bit to be honoured in RWS and Cat routers.
2019-01-30 12:16:57 +02:00
c2d3bdf7ef MXS-2273 Make schemarouter honour BEING_DRAINED bit
The schema router now deals with the being drained bit the same way
it deals with the maintenance bit, that is, a server being drained will
simply be ignored.

TODO: This behaviour needs to be document.
TODO: It seems the schema router simply ignores the maintenance bit
      once a connection has been establisdhed.
2019-01-30 12:16:57 +02:00
b564089afe MXS-2273 Take BEING_DRAINED bit into account in RCR
Also check when looking for the root master that not only the server ref
but also the referred to server is active.
2019-01-30 12:16:57 +02:00
a205c70374 MXS-2273 Allow the setting and clearing of BEING_DRAINED bit
Currently the bit is set so that is may be overwritten by the monitor
if the setting of the bit takes place while the monitor is performing
its monitor loop.
2019-01-30 12:16:57 +02:00
1f47e52c7b MXS-2273 Introduce SERVER_BEING_DRAINED bit
With this bit set, existing connections to a server should not be
closed, but no new connections should be created to the server.

The bits have also slight been rearranged.
- Bits 0 - 15 are now reserved for bits applicable to all servers
- Bits 16 - 31 are monitor specific

Further, the cases whether a server can be connected to and whether
it can be used, but be separated.
2019-01-30 12:16:57 +02:00
f94a28f033 maxscale-system-test: Inherit compiler flags
Inherit compiler flags when building maxscale-system-test from
main cmake file.
2019-01-30 12:09:16 +02:00
fcd3a6a384 Remove erroneous whitespace from config files
Some whitespace was missed.
2019-01-29 11:18:41 +02:00
6326172325 MXS-2271 Rename basic Monitor fields
Adds the m_-prefix.
2019-01-28 15:41:00 +02:00
cef4e836bc MXS-2271 Store monitored servers in a vector
The array is still a public member because it's used in several non-member functions.
2019-01-28 15:41:00 +02:00
9083ea2d02 MXS-2290 Reject use of whitespace in section names
Whitespace in section names was deprecated in 2.2 and in 2.4 it
will be rejected.
2019-01-28 12:22:28 +02:00
f78df53f30 MXS-2274 Add test
Check that use of reserved names (those starting with "@@") in
configuration file is rejected.
2019-01-28 12:22:28 +02:00
546b80de4b MXS-2271 Move monitor interval to settings container 2019-01-25 13:46:01 +02:00
10dc0f53e0 MXS-2177 Move check_monitor_permissions() into class 2019-01-25 13:46:01 +02:00
ddaba28d78 Merge branch '2.3' into develop 2019-01-25 12:45:58 +02:00
9f1619f4da MXS-2225 Provide documentation regarding default max[admin|ctrl] user 2019-01-25 12:45:25 +02:00
92b27500c7 MXS-2276 Fix things due to MXS_MONITOR -> Monitor change 2019-01-25 10:30:27 +02:00
42b3402a71 MXS-2276 Use dynamic servers also for cluster check
Once the monitor has been able to connect to a clustrix node
and obtain the clustrix nodes, it'll primarily use those nodes
when looking for a Clustrix node to be used as the "hub".
With this change it is sufficient (but perhaps unwise) to provide
a single node boostrap node in the configuration file.

Some other rearrangements and renamings of functions has also been
made.
2019-01-25 10:30:27 +02:00
0fe5b0bec9 MXS-2276 Expose lower level mon_ping_or_connect_to_db
The functionality is useful also when you do not have a
MXS_MONITORED_SERVER instance.
2019-01-25 10:28:34 +02:00
5ebd237a4f MXS-2290 Replace whitespace is section names with -
Whitespace in section names have been deprecated since 2.2 and will
be rejected in 2.4. Consequently, the configuration files of the
system tests must be updated.
2019-01-24 17:45:10 +02:00
6937bb6663 MXS-2274 Create globally unique name for dynamic servers
Convention needs to be that the runtime object creating other objects
needs to incorporate its own name in the name of any object created.
Together with the '@@' prefix that ensures that the created name will
be reasonably globally unique.
2019-01-24 17:42:29 +02:00
7d92717b66 MXS-2274 Prevent dynamic creation of object with invalid name
Unfortunately there is not a single place where the name could be
validated, but it has to be done separately for each object type.
2019-01-24 17:42:29 +02:00
5afceb1185 MXS-2274 Reserve names starting with @@ for use by MaxScale
Names starting with '@@' can now longer be used in configuration files.
Subsequent commits will prevent such names from being used when objects
are created dynamically.
2019-01-24 17:42:29 +02:00
efb8dd9c06 Merge branch '2.3' into develop 2019-01-24 17:00:51 +02:00
0f26a8bed6 MXS-2112 Add system info to support info script 2019-01-24 16:52:47 +02:00
cdabee6f06 MXS-2269 Explain PAM anonymous group mapping 2019-01-24 16:48:07 +02:00
c061f45d52 Update links in example configuration
The links were out of date and pointed to 2.2.
2019-01-24 16:14:38 +02:00