Commit Graph

5420 Commits

Author SHA1 Message Date
3fa4a85a1e MXS-2304 Use values instead of pointers in CONFIG_CONTEXT
Simplifies ctor/dtor.
2019-02-22 16:39:45 +02:00
5828c93112 MXS-2304 Convert static config parameter methods to non-static
Parameter handling changed in several places.
2019-02-22 15:17:55 +02:00
afe41c38ed Merge branch '2.3' into develop 2019-02-20 10:33:14 +02:00
9fbaafea91 MXS-2304 Remove additional module parameter classes
Equivalent functionality is now in the basic config parameter class.
2019-02-19 13:52:44 +02:00
48a6ab503e MXS-2292 PAM authenticator detects anonymous users with defined hosts
This allows anonymous user mapping from well-defined hosts.
2019-02-19 10:40:23 +02:00
bd3d5bb010 MXS-2329 Use durations in throttle filter 2019-02-19 10:11:57 +02:00
f3acf77a9f MXS-2329 Use durations in ccrfilter
The time window of the ccrfilter is now specified as a duration.
Internally, the time window is still always handled as seconds.
2019-02-19 10:11:57 +02:00
90e5b80b71 MXS-2050 Use global counter to detect log rotation request
Modules need to check the number regularly to detect a new log rotation.
2019-02-15 11:08:14 +02:00
98a081f65b MXS-2050 Separate session log and shared log handling
Shared log file is accessed under a lock.
2019-02-15 11:08:14 +02:00
21d9ec34cf MXS-2330 Use simpler queries
Since the current node id can be obtained using the function gtmnid()
the queries for finding out whether a node is in the quorum and whether
it is softfailed can be made simpler.
2019-02-15 08:09:03 +02:00
5c34550b40 MXS-2330 Do not use softfailed node as hub
When a softfailed node is finally revoked, it will appear as the
single node in a functioning Clustrix cluster. To ensure that the
Clustrix monitor will not stick to that node, if the node that is
used as hub is softfailed, it is immediately replaced with another
node.
2019-02-15 08:09:03 +02:00
1fed465fdb MXS-2246 Remove duplicate info in SERVICE and Service
Both of them contained fields for the service and router names.
Now the names are in SERVICE and they must be accessed via member
function.
2019-02-14 15:24:10 +02:00
2528c5fa4d MXS-2253 Make Cache use the new duration config type
Internally the Cache used seconds, so some changes were needed.
2019-02-14 10:57:55 +02:00
311704cdd9 MXS-2050 Clean up session log checking
Also moved constants around.
2019-02-13 10:36:36 +02:00
c5763beb28 MXS-2050 Check session file rotation
Session log files are now regularly checked for existence. If the log file
does not exist (likely because it has been rotated), a new log file is created.
2019-02-13 10:36:36 +02:00
16641a1f46 MXS-2050 Prepare to move file handling inside router sessions
The sessions will need to reopen the log file if it's rotated.
2019-02-13 10:36:36 +02:00
cc06f98e42 MXS-2050 Move diagnostics and command handlers inside class 2019-02-11 14:17:43 +02:00
661f1dd4e4 Merge branch '2.3' into develop 2019-02-11 13:14:52 +02:00
7a99b5d253 MXS-2314 Define monitor state in terms of worker state
Worker::STOPPED    -> MONITOR_STATE_STOPPED
Worker::POLLING    -> MONITOR_STATE_RUNNING
Worker::PROCESSING -> MONITOR_STATE_RUNNING

By defining the monitor state from the worker state there is
no risk they will ever get out of sync. And there is one thing
less to maintain.
2019-02-11 13:03:18 +02:00
cac1d76e48 MXS-2314 Monitor decides whether servers are added to services
When the servers of a service are defined by a monitor, then
at startup all servers of the monitor should be added to relevant
services. Likewise, when a server is added to or removed from a
monitor at runtime, those changes should affect services as well.

However, whether that should happen or not depends upon the monitor.
In the case of the Clustrix monitor this should not happen as it
adds and removes servers depending on the runtime state of the
Clustrix cluster.
2019-02-11 13:03:18 +02:00
b4eb87dfcc MXS-2314 Populate services with servers
The services whose servers are defined using a monitor, will
now be populated from the monitor.

Note, no consideration has yet been given to runtime changes.
2019-02-11 13:03:18 +02:00
aea64aede2 Prune only when history size is exceeded
The documentation stated that at most `max_sescmd_history` commands were
kept but in reality the number of commands kept in the history was one
command smaller than what was documented.
2019-02-11 10:58:17 +02:00
b93d35ab03 Revert "MXS-2300: Fix off-by-one bug in history size"
This reverts commit 840b4b24bd048ed536621d4433abbb4e846dfcc5.
2019-02-11 10:58:17 +02:00
d04fc6c4b9 Merge branch '2.2' into 2.3 2019-02-08 16:14:58 +02:00
46484b4e11 MXS-2311: Write queued packet one at a time
If an ignorable packet was followed by more than one queued packets, they
would all get routed in the same batch. This would cause unexpected
replies from the server if multiple ignorable packets were queued up.
2019-02-08 14:18:41 +02:00
19ab89144b MXS-2050 Move filter settings to a container 2019-02-08 13:49:11 +02:00
c09128111c MXS-2050 Move more static functions to class methods 2019-02-08 13:49:11 +02:00
81f1cf567e MXS-2050 Rearrange methods
Several functions moved to class methods.
2019-02-08 13:47:45 +02:00
7bbd155a7a MXS-2050 Clean up qlafilter code
Move class and related declarations to a header file, run uncrustify.
2019-02-08 13:47:45 +02:00
8c5c93eb60 Remove superfluous const casts 2019-02-08 12:27:45 +02:00
3550048c19 Fix mock-framework
Got broken due to changes in how configuration settings are handled.
2019-02-08 12:12:31 +02:00
35ab911d5c MXS-2304 Use configuration class methods instead of separate implementations
Replaces parameter add/set/remove/free.
2019-02-07 13:51:16 +02:00
ed80680da9 MXS-2304 Add ctor/dtor and other functions to parameter class
The manipulation functions are currently static so that the container can be initialized
if required. This will be fixed later.

The new functions are taken into use in monitor management.
2019-02-07 13:51:16 +02:00
42b5c39f43 Merge branch '2.3' into develop 2019-02-07 10:50:27 +02:00
08a05d3ab9 Fix use of uninitialized variables
Building with optimization in debug mode revealed code that could in
theory result in undefined behavior.
2019-02-06 14:22:24 +02:00
78d9ef2910 MXS-2304 Remove remaining uses of config_get_string() from module code
The function returns a pointer to an internal string and should not be
used.
2019-02-06 12:36:23 +02:00
5ab7734e9d MXS-2304 Add contains() to test if a parameter exists
Replaces uses of config_get_param() in modules either with contains()
or get_string(). The config_get_param() is moved to internal headers,
as it allows seeing inside a config setting.
2019-02-06 12:36:23 +02:00
b8be905b08 Merge branch '2.3' into develop 2019-02-06 12:24:09 +02:00
5e19d1d044 MXS-2315: Use BRE with std::regex
The default ECMAScript syntax appears to be broken on CentOS 7 which
effectively prevents its use in most cases. A more reliable alternative
would be to use the bundled PCRE2 library but the basic POSIX regular
expressions seem to work.
2019-02-06 12:11:06 +02:00
5a409f313a MXS-2304 Config string handling cleanup
Using correct functions in most cases.
2019-02-05 10:52:46 +02:00
4132c9bbbc MXS-2304 Use get_c_str_copy instead of config_copy_string()
Also uses get_string() in core-code when appropriate.
2019-02-05 10:28:37 +02:00
692dd195ec MXS-2275 Trigger cluster check if node is down
The likely reason for a node being down is that some cluster level
modifications have been performed. Consequently a cluster check should
be triggered in that case.
2019-02-04 12:02:58 +02:00
51884c4599 Ignore malformed .avsc files
If the file name is wrong, ignore it.
2019-02-04 11:15:39 +02:00
6295732bee MXS-2310: Document and install cdc_one_schema.py
Added documentation for the script and installed it as a part of the
default package.
2019-02-04 11:15:38 +02:00
87abd56f8b MXS-2310: Add offline schema generation script
The script generates the required .avsc files without requiring a direct
connection to the database. This makes it easier to generate schemas in
more secure installations where direct access and installing dependencies
might not be easy.
2019-02-04 11:15:38 +02:00
3eb7d89c80 MXS-2304 Use get_service() and get_server() 2019-02-01 17:31:41 +02:00
882d360355 MXS-2304 Use get_size() instead of config_get_size() 2019-02-01 17:23:14 +02:00
b357717149 MXS-2304 Use get_bool() instead of config_get_bool() 2019-02-01 17:18:49 +02:00
7cb969b0d9 MXS-2271 Clean up server list parsing functions, use in monitor config
The functions now return the parsed array.
2019-02-01 14:59:51 +02:00
6038f1f386 Merge branch '2.3' into develop 2019-02-01 13:55:54 +02:00