Commit Graph

76 Commits

Author SHA1 Message Date
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
a59c0c61ce Remove depth field from SERVER
It was not really used anymore.
2018-06-29 10:54:34 +03:00
8ea7d8898a MXS-1915 Remove id from mxs::Worker
The id has now been moved from mxs::Worker to mxs::RoutingWorker
and the implications are felt in many places.

The primary need for the id was to be able to access worker specfic
data, maintained outside of a routing worker, when given a worker
(the id is used to index into an array). Slightly related to that
was the need to be able to iterate over all workers. That obviously
implies some kind of collection.

That causes all sorts of issues if there is a need for being able
to create and destroy a worker at runtime. With the id removed from
mxs::Worker all those issues are gone, and its perfectly ok to create
and destory mxs::Workers as needed.

Further, while there is a need to broadcast a particular message to
all _routing_ workers, it hardly makes sense to broadcast a particular
message too _all_ workers. Consequently, only routing workers are kept
in a collection and all static member functions dealing with all
workers (e.g. broadcast) have now been moved to mxs::RoutingWorker.

Now, instead of passing the id around we instead deal directly
with the worker pointer. Later the data in all those external arrays
will be moved into mxs::[Worker|RoutingWorker] so that worker related
data is maintained in exactly one place.
2018-06-26 09:19:46 +03:00
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
9f5358eac0 Remove server_get_parameter_nolock
The function is no longer needed as there is no recursive access to the
server.
2018-06-08 14:41:11 +03:00
0d73530ff3 Merge branch '2.2' into develop 2018-06-08 11:30:55 +03:00
a7dd2127d6 Merge branch '2.1' into 2.2 2018-06-08 11:21:35 +03:00
880db1353a Merge branch '2.2' into develop 2018-06-07 14:39:16 +03:00
3c0f301674 MXS-1709 Fix to test_server 2018-06-06 22:36:10 +03:00
82a95bfe2d MXS-1709 Fix memory leaks causing test_server to fail 2018-06-06 22:36:10 +03:00
7cd19a12a2 MXS-1883 Remove locking during monitor loop
Since the admin cannot modify server states any more, the locks are not
required.
2018-06-01 15:03:07 +03:00
37841183b3 Cleanup server.h
Renamed, rearranged and clarified status bits. Removed unused macros.
2018-06-01 14:29:51 +03:00
c0ace6a694 MXS-1775 Rename server_clear_set_status
Renamed to server_clear_set_status_nolock, like all other non-locking
functions are called. Rename arguments to be self-explanatory.
2018-06-01 13:48:15 +03:00
11c04ff8a8 MXS-1775 Add disk space threshold to server and monitor
- Instance variable.
- Functions for setting it from configuration file.
2018-06-01 13:48:15 +03:00
c039821467 MXS-1883 Maintenance is now the only user-modifiable bit for a monitored server
The request to turn maintenance off/on is a separate flag, although the actual
status is still contained in the status bitfield.
2018-05-30 10:09:15 +03:00
95815df1db Merge branch '2.2' into develop 2018-05-16 11:46:45 +03:00
fda5bc8e56 Add persistent connection count to servers resource
The number of persisted connections was not shown in the server resource.
2018-05-16 11:13:36 +03:00
7e9062f20f Merge branch '2.2' into develop 2018-05-16 09:31:13 +03:00
54ac0992f7 Use address of spinlock
The SPINLOCK_IS_LOCKED macro assumes that a pointer to a spinlock is given
as the parameter.
2018-05-15 10:33:05 +03:00
97eb7d2f9e Fix deadlock in galeramon
The parameter extraction caused a recursive lock of the server
spinlock. To work around this, an unlocked version of server_get_parameter
is needed.

Ideally, a lock-free setup would be used but due to this being a bug fix,
it will have to be done later on.
2018-05-15 10:15:26 +03:00
42c10cfa1c MXS-1848 Move Worker from internal to public include dir
maxscale::Worker needs to be public if monitors should be
implementable using it.
2018-05-14 10:10:18 +03:00
12035289f4 Remove server authenticator options
Was unused. A warning is printed if the parameter is defined. Any value is ignored.
2018-05-08 14:18:00 +03:00
b44f2cfa36 Remove SERVER->slaves field
The field was only used by MariaDB-Monitor. A later commit will add equivalent
information to the monitor diagnostics function.
2018-05-07 13:51:06 +03:00
4a0df97e02 Merge branch '2.2' into develop 2018-05-04 10:18:48 +03:00
2bb6c84be0 MXS-1847: Return value length in server_get_parameter
Returning the length of the value instead of a boolean allows the user to
know when the parameter value exceeded the buffer size passed as the
parameter.
2018-05-04 10:16:31 +03:00
658329b648 Merge branch '2.2' into develop 2018-05-03 10:00:44 +03:00
42c468ff16 MXS-1847: Make server parameter updates atomic
The updates to server parameters are now performed in an atomic manner.
2018-05-03 09:50:52 +03:00
612b4e1a32 MXS-1847: Fix server_get_parameter
The function now takes an output buffer as a parameter. This prevents race
conditions by copying the parameter value into a local buffer.
2018-05-03 09:50:52 +03:00
121d255780 Add protocol packet statistics to servers
The individual servers were missing a statistic that would give an
estimated query count. As there is no simple way to count queries for all
modules, counting the number of routed protocol packets is a suitable
substitute.
2018-05-03 09:50:45 +03:00
5d010ff712 Cleanup SERVER struct
Removed one unused field. Rearranged others, clarified comments.
2018-04-27 10:48:56 +03:00
230876cd69 MXS-1754 Rename mxs::Worker to mxs::RoutingWorker
A new class mxs::Worker will be introduced and mxs::RoutingWorker
will be inherited from that. mxs::Worker will basically only be a
thread with a message-loop.

Once available, all current non-worker threads (but the one
implicitly created by microhttpd) can be creating by inheriting
from that; in practice that means the housekeeping thread, all
monitor threads and possibly the logging thread.

The benefit of this arrangement is that there then will be a general
mechanism for cross thread communication without having to use any
shared data structures.
2018-04-16 14:53:08 +03:00
b33f464eea MXS-1506: Make heartbeat reads atomic
The old hkheartbeat variable was changed to the mxs_clock() function that
simply wraps an atomic load of the variable. This allows it to be
correctly read by MaxScale as well as opening up the possibility of
converting the value load to a relaxed memory order read.

Renamed the header and associated macros. Removed inclusion of the
heartbeat header from the housekeeper header and added it to the files
that were missing it.
2018-04-10 15:29:29 +03:00
fad4508fe2 Merge branch '2.1' into 2.2 2018-04-10 13:49:42 +03:00
a91b857a43 MXS-1593: Don't display stale status
As the stale status is not a real status bit and it's used to retain the
history of a master, there is no need to print it in any output. This
output will only confuse users now that the stale status will not be
cleared from masters that go down.
2018-01-04 15:02:24 +02:00
79afaa447e Merge branch '2.1' into 2.2 2017-12-12 13:23:02 +02:00
396b81f336 Fix in-source builds
The internal header directory conflicted with in-source builds causing a
build failure. This is fixed by renaming the internal header directory to
something other than maxscale.

The renaming pointed out a few problems in a couple of source files that
appeared to include internal headers when the headers were in fact public
headers.

Fixed maxctrl in-source builds by making the copying of the sources
optional.
2017-11-22 18:40:18 +02:00
afcb708e6e Merge branch '2.1' into 2.2 2017-11-21 16:49:21 +02:00
b80f394cd0 Use explicit types
Use uint64_t instead of unsigned. This guarantees that the size of the
type is the same across all platforms.
2017-11-14 16:53:09 +02:00
3a78b716b8 Merge branch '2.2' into 2.2-mrm 2017-10-30 11:06:34 +02:00
582a65f77c Do not return empty relationships
If no relationships of a particular type are defined for a resource, the
key for that relationship should not be defined.
2017-10-23 19:37:24 +03:00
89d1f81e37 Merge branch '2.2' into 2.2-mrm 2017-09-28 15:19:20 +03:00
895d950da0 Format all source files with Astyle
Formatted all source files Astyle.
2017-09-28 07:04:21 +03:00
0d6c06f33d MXS-1446: Add heartbeat conversion macros
The macros make the conversion from heartbeats to seconds more convenient
and consistent.
2017-09-27 19:44:25 +03:00
ef2ee38ccf MXS-1446: Store more detailed event information
The timestamp of the last change from passive to active is now
tracked. This, with the timestamps of the last master_down and master_up
events, allows detection of cases when MaxScale was failed over but the
failover was not done.

Currently, only a warning is logged if no new master has appeared within
90 seconds of a master_down event and MaxScale was set to active from
passive.

The last event and when the event was triggered is now shown for all
servers. The latest change from passive to active is also shown.
2017-09-27 19:32:58 +03:00
02b9e0a01d Merge branch '2.1.7' into develop-2.1-merge 2017-09-12 11:08:02 +03:00
486024aaf4 MXS-1390: Add missing SSL parameter processing to servers resource
Added missing SSL parameters to servers resource output as well as added
the processing of these parameters when servers are created. It is
preferable to define servers as either encrypter or plain and to prevent
the modification of this at runtime.
2017-09-11 12:49:11 +03:00
de7004cb95 Merge branch '2.1' into develop 2017-08-15 10:31:30 +03:00
1743f4c1b7 Handle server repurposing under a lock
By moving the repurposing of the servers under the global server lock, the
repurposing of a server and allocation of a new server behave in the same
way.

Also fixed the wrong error message on server creation failure referring to
invalid server relationships.
2017-08-09 11:39:24 +03:00
8e9c943d48 Proxy protocol setting error detection + documentation
The setting parsing is now similar to the other server settings.
The header is printed if log_info is on.
Changed the setting name to simply "proxy_protocol".
Updated documentation.
2017-08-04 11:43:29 +03:00
26bf342e6b Merge branch '2.1' into develop 2017-07-24 12:37:25 +03:00