Commit Graph

624 Commits

Author SHA1 Message Date
043232990c MXS-1859 Correct merge bug
Version comparison was wrong.
2018-05-21 15:58:12 +03:00
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
709c076000 Merge branch '2.2' into develop 2018-05-18 16:31:49 +03:00
f3973b331f Fix rebase error. 2018-05-18 16:00:05 +03:00
650a739c92 MXS-1775 Move monitor loop to MonitorInstance 2018-05-18 16:00:05 +03:00
db30ea96f2 MXS-1775 m_master is now a member variable of MonitorInstance 2018-05-18 16:00:05 +03:00
5aa30e8613 MXS-1775 AurorMon now hangs up as the other monitors do 2018-05-18 16:00:05 +03:00
6eef6f52db MXS-1775 Wait the same way in all monitors 2018-05-18 16:00:05 +03:00
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
6fff5a4f23 MXS-1775 Preparatory work for moving main loop to MonitorInstance 2018-05-18 16:00:05 +03:00
6db4ce54a9 MXS-1775 MonitorInstance now calls mysql_thread_[init|finish]() 2018-05-18 16:00:05 +03:00
15e3a2887c MXS-1775 Move status management to MonitorInstance 2018-05-18 16:00:05 +03:00
1e084b78b1 MXS-1775 MonitorInstance::m_script is now a std::string 2018-05-18 16:00:05 +03:00
c7eb0a9958 MXS-1775 Thread starting is now handled by MonitorInstance 2018-05-18 16:00:05 +03:00
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
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
bcb7d09a15 MXS-1775 Monitor stopping moved to maxscale::MonitorInstance 2018-05-18 16:00:05 +03:00
1304fd6147 MXS-1775 Move thread main function to maxscale::MonitorInstance 2018-05-18 16:00:05 +03:00
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
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
90f1784d21 MXS-1775 Turn NDBC monitor into a class.
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
4b236a79db MXS-1775 Turn Galera monitor into a class.
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
cd233fe594 MXS-1775 Turn MM monitor into a class
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
cc7a154e7d MXS-1775 Turn Aurora monitor into a class.
A mechanical change, without any functional modifications.
2018-05-18 16:00:05 +03:00
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
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
a31549221b MXS-1845 Print all slave connections at 'show monitors'
The format has changed.
2018-05-18 13:48:08 +03:00
45da5a08d9 MXS-1845 Cleanup monitor backend updating
Now detects errors and prints them.
2018-05-18 13:48:08 +03:00
654b5f1958 MXS-1865 Wrong permissions on backends no longer cause monitor start to fail
The logic was weird, as the permission checking function assumes a disconnected
server as fine. The checking is now done when starting the main loop and lacking
grants print errors but does not stop the monitor.
2018-05-16 13:55:45 +03:00
b71710e066 MXS-1865 Combine server version and type
Binlog server is now handled better.
2018-05-16 13:55:45 +03:00
b29bae6e84 MXS-1865 Update server version only when (re)connecting
Updating it every iteration is needless.
2018-05-16 13:55:45 +03:00
7e9062f20f Merge branch '2.2' into develop 2018-05-16 09:31:13 +03:00
ee2c3e21c7 Fix server priority regression
Servers without priorities were chosen instead of servers with
priorities. This caused at least the server_weight test to fail.
2018-05-15 10:15:32 +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
c6b8277281 Cleanup server status querying
No functional changes except that status changes are no longer logged when
querying. It was bugged to begin with.
2018-05-14 11:32:02 +03:00
df4454027a Clean up monitor initialization and destruction
Since monitors are now freed at MaxScale exit, the server data should be freed. Also,
gtid domain variables are now initialized with a common constant.
2018-05-14 11:32:02 +03:00
97328a61f0 Use MonitorApi in MariaDBMonitor 2018-05-14 11:11:08 +03:00
b92284afc4 Move server querying to MariaDBServer
The query functions still require the base monitor struct because of
mon_ping_or_connect_to_db().
2018-05-14 11:11:08 +03:00
38647a0c69 Increase monitor sleep accuracy
Now the last sleep of a monitor loop is of correct duration.
2018-05-14 11:11:08 +03:00
0b459c0496 Always check monitor permissions when starting monitor
Servers could have been added while monitor was down so better be on the safe side.
2018-05-14 11:11:08 +03:00
370b3be576 MXS-1703 Support "Preparing" in Slave_IO_Running
Is interpreted as "Connecting".
2018-05-09 12:49:23 +03:00
0c5af4b13f Merge branch '2.2' into develop 2018-05-08 14:10:52 +03:00
39789c19d3 MXS-1856 Do not set read_only OFF if join_cluster() fails
This could in some cases leave read_only OFF even if the target slave
begins replication.
2018-05-08 13:56:57 +03:00
fe0ed99df4 MXS-1848 Fix typo 2018-05-08 13:44:28 +03:00
401dc79dad MXS-1848 Implement GRMon using maxscale::MonitorApi 2018-05-07 14:53:48 +03:00
44fa2a4be2 MXS-1848 Change prototype of startMonitor
StartMonitor() now takes a MXS_MONITOR_INSTANCE and returns
true, if the monitor could be started and false otherwise.
So, the setup is such that in createInstance(), the instance
data is created and then using startMonitor() and stopMonitor()
the monitor is started/stopped. Finally in destroyInstance(),
the actual instance data is deleted.
2018-05-07 14:08:36 +03:00
5c1083c4aa MXS-1848 Parameters are not available at createInstance time
The monitor parameters are not available when the monitor instance
is created so at least for the time being they are removed from
the API.
2018-05-07 14:08:36 +03:00
81654fb0e7 MXS-1848 Rename monitor types and instance variable
The following type name changes

  MXS_MONITOR_OBJECT   -> MXS_MONITOR_API
  MXS_SPECIFIC_MONITOR -> MXS_MONITOR_INSTANCE

Further, the 'handle' instance variable of what used to be
called MXS_MONITOR_OBJECT has been renamed to 'api'.

An example, what used to look like

   mon->module->stopMonitor(mon->handle);

now looks like

  mon->api->stopMonitor(mon->instance);

which makes it more obvious what is going on.
2018-05-07 14:08:36 +03:00
510eb7ec7c MXS-1848 Change monitorCamelCase to monitor_snake_case 2018-05-07 14:08:36 +03:00
60228f0f26 MXS-1848 Implement createInstance() and destroyInstance()
CreateInstance() (renamed from initMonitor()) and destroyInstance()
(renamed from finishMonitor()) have now tentatively been
implemented for all monitors.

Next step is to

1) change the prototype of startMonitor() to

       bool (*startMonitor)(MXS_SPECIFIC_MONITOR*,
                            const MXS_MONITOR_PARAMETER*);

   and assume that mon->handle will always contain the
   instance,
2) not delete any data in stopMonitor(),
3) add monitorCreateAll() that calls createInstance() for all
   monitors (and call that in main()), and
4) add monitorDestroyAll() that calls destroyInstance() for
   all monitors (and call that in main()).
2018-05-07 14:07:05 +03:00