10531 Commits

Author SHA1 Message Date
Markus Mäkelä
cdb43335a2
MXS-553: Update and document the protocol API
Removed unused and properly documented all entry points in the protocol
module API. As the removal of the `session` entry point is an backwards
incompatible change, the protocol API version was updated.
2018-05-22 17:46:25 +03:00
Markus Mäkelä
66255361dc
MXS-553: List connections in sessions resource
The connections that relate to a particular session are now a part of the
sessions resource. Currently, only the generic information is stored for
each connection (id and server name).
2018-05-22 17:46:25 +03:00
Markus Mäkelä
621139f901
MXS-553: Use dcb_set for KILL command handling
Now that the set of DCBs is stored in the session, it can be used to speed
up the handling of the KILL command processing by stopping when the first
related DCB is found.
2018-05-22 17:46:24 +03:00
Markus Mäkelä
643fc825fa
MXS-553: Provide full session to DCB mapping
By storing a link to the backend DCBs in the session object itself, we can
reach all related objects from the session. This removes the need to
iterate over all DCBs to find the set of related DCBs.
2018-05-22 17:46:24 +03:00
Johan Wikman
de0541f76b MXS-1875 Use RoutingWorker and not Worker
DCBs will only be used in conjunction with RoutingWorkers and
hence RoutingWorker and not just Worker must be used when looking
for the current worker and worker id.

The reason is that RoutingWorker cheats; the current worker id is
set to 0 at initialization time, which indicates that a worker would
be running although it isn't.

The reason is that as listeners are created before any worker has
been started, that arrangement ensures that listening DCBs are
book-kept in the worker running in the main thread.

Now, that is a kludge. It ought to be changed so that a, say,
MainRoutingWorker class is introduced that in its run function
initializes MaxScale and then continues running as any regular
RoutingWorker. In due time.
2018-05-22 16:49:16 +03:00
Johan Wikman
0d92b0bc8f Merge branch '2.2' into develop 2018-05-22 16:18:36 +03:00
Johan Wikman
498572c671 MXS-1775 Add mxs::[l|r]trimmed_copy(const std::string&)
Make it more convenient to get a left-trimmed, right-trimmed
or trimmed copy of a string.
2018-05-22 16:18:17 +03:00
Johan Wikman
3097137a2f MXS-1875 Ensure cleanup of DCB does not cause crash.
- If a client DCB should be moved to some other worker than
  the current one (cli and maxinfo), and that fails, the
  thread id must be reset to that of the calling thread as
  otherwise asserts will be triggered.
- If the creation of the first DCB fails, then the dcb list
  for that thread will be NULL and thus must be accessed
  with some caution.
2018-05-22 16:18:02 +03:00
Markus Mäkelä
14dc215a78
Trunate logs instead of removing
By truncating the files, tests can be run while the log is being
tailed. If they are removed, the files need to be reopened each time a
test is started.
2018-05-22 15:44:55 +03:00
Markus Mäkelä
1b46679126
MXS-1878: Maximize pipe buffer size
When the pipe buffer size is maximized, the message queue can hold more
messages. This will mitigate the problem of too many messages being placed
in the queue.
2018-05-22 15:44:55 +03:00
Markus Mäkelä
0e686dd0f3
MXS-1878: Immediately process hangups
When DCBs are being hung in dcb_hangup_foreach, the hangup event can be
processed directly. This prevents excessive use of the worker message
queue pipe thus reducing the possibility of it being full.
2018-05-22 15:44:55 +03:00
Markus Mäkelä
e7fd8ac6cb
Document stopping procedure for avrorouter
The safest way to stop the avrorouter is to stop replication and wait for
the conversion to halt. This was not previously documented and needs to be
mentioned in the router documentation.
2018-05-22 15:44:55 +03:00
Johan Wikman
bced61c6d8 MXS-1875 Log in correct branch
Also use different error message to make it plain where it is
logged.
2018-05-22 08:42:48 +03:00
Johan Wikman
f166b50b37 MXS-1875 Add fd and make note of DCB simultaneously
The fact that a client dcb was immediately added to the epoll-
instance of the relevant worker (possible, since that is thread-
safe), but was added to the book-keeping via the message mechanism
(necessary, since that is not thread-safe), meant that if the
connection was closed before the message was delivered, the handling
of the message then caused an access error.

Now the fd is also added to the epoll-instance via the messaging
mechanism, so the problem can no longer occur. The only fds this
affects are connections made to maxadmin or maxinfo as they are
always handled by the main thread due to deadlock issues.
2018-05-21 20:04:13 +03:00
Esa Korhonen
043232990c MXS-1859 Correct merge bug
Version comparison was wrong.
2018-05-21 15:58:12 +03:00
Johan Wikman
0f8bf9b6e2 Implement mxs::[l|r]trim(std::string&);
Also remove the non-used implementation in httprequest.cc
2018-05-21 10:18:42 +03:00
Johan Wikman
096f5e4dc6 Update 2.2 version number 2018-05-21 10:16:58 +03:00
Johan Wikman
2e8c19f6be Merge branch '2.2' into develop 2018-05-21 10:06:20 +03:00
Johan Wikman
76f32a38ac Update release date 2018-05-21 10:05:58 +03:00
Markus Mäkelä
540df997fb
Remove unused templates file
The file has not been used since the templates.h header was added.
2018-05-21 09:50:44 +03:00
Markus Mäkelä
7af9a500ac
MXS-1853: Treat MySQL 8.0 as 5.7 in authenticators
Using the MySQL 5.7 syntax is required to get the authenticators to work
with 8.0.
2018-05-21 09:50:44 +03:00
Markus Mäkelä
bdde3c44d9
Document slave_selection_criteria and weightby interaction
Documented how the slave_selection_criteria and server weights work.
2018-05-21 09:50:43 +03:00
Esa Korhonen
4788c4947d Merge branch 'read_only' into develop
develop was updated before a merge was pushed, requiring a second merge.
2018-05-18 16:51:38 +03:00
Esa Korhonen
709c076000 Merge branch '2.2' into develop 2018-05-18 16:31:49 +03:00
Niclas Antti
f88f0ffe47 MXS-173 switched to use maxscale::Worker::delayed_call()
Using delayed_call rather than usleep. This caused a fair amount of changes to
the timing ascpects (or delaying). Also some other small changes; more config
and all durations in milliseconds.
2018-05-18 16:24:45 +03:00
Johan Wikman
f3973b331f Fix rebase error. 2018-05-18 16:00:05 +03:00
Johan Wikman
9d526332d8 MXS-1775 Ensure MonitorInstance::start() returns correct value
Since we need to call mysql_thread_init(), which can fail, in
the monitor thread, we need to wait for the outcome of that
before we can return from start().
2018-05-18 16:00:05 +03:00
Johan Wikman
650a739c92 MXS-1775 Move monitor loop to MonitorInstance 2018-05-18 16:00:05 +03:00
Johan Wikman
db30ea96f2 MXS-1775 m_master is now a member variable of MonitorInstance 2018-05-18 16:00:05 +03:00
Johan Wikman
5aa30e8613 MXS-1775 AurorMon now hangs up as the other monitors do 2018-05-18 16:00:05 +03:00
Johan Wikman
6eef6f52db MXS-1775 Wait the same way in all monitors 2018-05-18 16:00:05 +03:00
Johan Wikman
2396b555f8 MXS-1775 Monitor loop and monitoring separated
In preparation for moving the monitor loop to MonitorInstance.
2018-05-18 16:00:05 +03:00
Johan Wikman
6fff5a4f23 MXS-1775 Preparatory work for moving main loop to MonitorInstance 2018-05-18 16:00:05 +03:00
Johan Wikman
6db4ce54a9 MXS-1775 MonitorInstance now calls mysql_thread_[init|finish]() 2018-05-18 16:00:05 +03:00
Johan Wikman
15e3a2887c MXS-1775 Move status management to MonitorInstance 2018-05-18 16:00:05 +03:00
Johan Wikman
1e084b78b1 MXS-1775 MonitorInstance::m_script is now a std::string 2018-05-18 16:00:05 +03:00
Johan Wikman
c7eb0a9958 MXS-1775 Thread starting is now handled by MonitorInstance 2018-05-18 16:00:05 +03:00
Johan Wikman
adb7f156d6 MXS-1775 Introduce MonitorInstance::has_sufficient_permissions()
With this function in place, it is now possible to move the thread
starting to MonitorInstance.
2018-05-18 16:00:05 +03:00
Johan Wikman
3606a5ed1c MXS-1775 Introduce MonitorInstance::configure() function
The configuring of the monitor instance is now performed in a
separate function. That is in preparation for the moving of the
start function to maxscale::MonitorInstance.
2018-05-18 16:00:05 +03:00
Johan Wikman
bcb7d09a15 MXS-1775 Monitor stopping moved to maxscale::MonitorInstance 2018-05-18 16:00:05 +03:00
Johan Wikman
1304fd6147 MXS-1775 Move thread main function to maxscale::MonitorInstance 2018-05-18 16:00:05 +03:00
Johan Wikman
3c277f4e5e MXS-1775 Introduce maxscale::MonitorInstance
- All monitors (but MariaDBMon for the time being) inherit
  from that.
- All common member variables moved to that class. Still
  manipulated in derived classes.

In subsequent commits common functionality will be moved to
that class.
2018-05-18 16:00:05 +03:00
Johan Wikman
787a0b50ef MXS-1775 Cleanup monitor class headers
- All classes now declared in separate header file
- Header files have .hh-suffix
2018-05-18 16:00:05 +03:00
Johan Wikman
90f1784d21 MXS-1775 Turn NDBC monitor into a class.
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
Johan Wikman
4b236a79db MXS-1775 Turn Galera monitor into a class.
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
Johan Wikman
cd233fe594 MXS-1775 Turn MM monitor into a class
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
Johan Wikman
cc7a154e7d MXS-1775 Turn Aurora monitor into a class.
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
Johan Wikman
d5871e48ae MXS-1775 Change assumption of Monitor::destroy() function
Used to be assumed to be a static member function, now assumed
to be a regular member function.
2018-05-18 16:00:05 +03:00
Johan Wikman
b72a7a8926 Update 2.2.6 release notes 2018-05-18 15:36:16 +03:00
Esa Korhonen
fb56de641a MXS-1859 Add options for enforcing read_only on slaves
If the feature is enabled (default off), at the end of a monitor loop
(once server states are known), read_only is enabled on slaves servers
without it.
2018-05-18 15:29:56 +03:00