26 Commits

Author SHA1 Message Date
Esa Korhonen
4d7aff4ab9 MXS-1845 Find strongly connected components with multiple slave connections
Rewrote the algorithm for clarity.
2018-06-01 14:04:50 +03:00
Esa Korhonen
3ec449339f Only write to SERVER->status at the end of a monitoring loop
This makes the code clearer and reduces race conditions, as the monitor
could be writing SERVER->status while a router is reading it. Also,
the time during which the SERVER struct is locked drops to a fraction.
2018-05-23 16:19:08 +03:00
Esa Korhonen
a31549221b MXS-1845 Print all slave connections at 'show monitors'
The format has changed.
2018-05-18 13:48:08 +03:00
Esa Korhonen
45da5a08d9 MXS-1845 Cleanup monitor backend updating
Now detects errors and prints them.
2018-05-18 13:48:08 +03:00
Esa Korhonen
b71710e066 MXS-1865 Combine server version and type
Binlog server is now handled better.
2018-05-16 13:55:45 +03:00
Esa Korhonen
b29bae6e84 MXS-1865 Update server version only when (re)connecting
Updating it every iteration is needless.
2018-05-16 13:55:45 +03:00
Esa Korhonen
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
Esa Korhonen
ba4700a983 MXS-1745 Remove unused fields
The binlog file and position are no longer used. Gtid_IO_Pos can fulfill
the same purpose if needed.
2018-04-27 10:48:56 +03:00
Esa Korhonen
de1e299f3f MXS-1745 Save all rows from SHOW ALL SLAVES STATUS
The master down verification through slaves won't work with this commit. It needs to be
redesigned to handle multiple slave connections or removed. Also, only the first row of
slave status data is used by the monitor, so multiple slave connections are still
incorrectly handled.
2018-04-27 10:48:45 +03:00
Esa Korhonen
7c933df56f MXS-1703 Remove support for MariaDB/MySQL versions less than 5.5
5.1 to 5.3 are officially not supported anymore, so support can be removed from
the monitor. This allows removing the config parameter "mysql51_replication".
2018-04-26 10:47:57 +03:00
Esa Korhonen
8e3bec5d09 MXS-1703 Rename fields in SlaveStatus
Althought the fields are still public, having the 'm_' is clearer.
2018-04-26 10:47:57 +03:00
Esa Korhonen
a28aac8de0 MXS-1703 Cleanup do_show_slave_status()
Slave_IO_Running is now properly parsed. Renamed class to SlaveStatus.
2018-04-26 10:47:57 +03:00
Esa Korhonen
caa964fa57 Merge branch '2.2' into develop 2018-04-24 13:57:50 +03:00
Esa Korhonen
289f4990d6 Merge branch '2.2' into develop 2018-04-23 11:48:38 +03:00
Esa Korhonen
02c57c98e4 MXS-1703 Move more methods to MariaDBServer
These methods only modify or update a single server.
2018-04-18 10:27:16 +03:00
Esa Korhonen
50bc43e4bf MXS-1703 Move server-specific diagnostic printing to MariaDBServer 2018-04-18 10:27:16 +03:00
Esa Korhonen
4d6239635e MXS-1703 Add and use convenience functions for common macros/fields
Also add debug assert to MariaDBServer ctor.
2018-04-13 13:31:12 +03:00
Esa Korhonen
b6e421e13b MXS-1703 Use a common header for all mariadbmon files
The mariadb_common.hh file is now a header with only common definitions
such as module name. The QueryResult-class was moved to MariaDBServer.
2018-04-12 13:06:36 +03:00
Esa Korhonen
147355bbdb MXS-1744 Use gtid querying instead of MASTER_GTID_WAIT when waiting for catchup
MASTER_GTID_WAIT uses gtid_slave_pos when comparing to the target gtid. This creates
problems with multi-domain gtids. It's simpler to just query the server for its
gtids repeatedly. Also, the method is now in MariaDBServer.
2018-04-09 10:51:16 +03:00
Esa Korhonen
174db469f3 MXS-1744 Rename and clean up gtid code, move to separate file
Renamed the two gtid-classes to better match MariaDB documentation. One
domain-server-sequence-combination is now a "Gtid", as these identify
a transaction. A "GtidList" contains a list of Gtid:s for handling multi-domain
server variables composed of multiple comma separated Gtid:s.

Removed unused methods and renamed some existing ones. Moved the Gtid-code
to its own file.
2018-04-06 10:23:02 +03:00
Esa Korhonen
e43678bed9 MXS-1744 Take new Gtid-class into use
Also cleaned up mariadbserver a bit.
2018-04-06 10:16:29 +03:00
Esa Korhonen
aaa8c92886 MXS-1744 Implement a Gtid-class which can store multi-domain gtid:s
The operations between Gtid:s are now more complicated so the class implements
them instead of the monitor. The Old Gtid-container has been renamed
GtidTriplet, and only stores the values for one triplet.
2018-04-04 15:53:42 +03:00
Esa Korhonen
923de851f9 MXS-1703 Move more functions to MariaDBServer
Also, the QueryResult integer reading method now only reads non-negative integers
since the server rarely returns negative values. This frees negative values for
indicating parsing error(s).

Gtid-class was moved back to utility.hh/.cc because the QueryResult-class requires it.
2018-03-28 13:47:07 +03:00
Esa Korhonen
1d5128fc5b MXS-1703 Move do_show_slave_status() to MariaDBServer
Also took into use the QueryResult helper class.
2018-03-27 12:43:36 +03:00
Esa Korhonen
a4a5641f5b MXS-1703 Add convenience function + class for querying and storing results
An object of the class is returned as an auto_ptr to simplify memory management.
2018-03-26 15:43:54 +03:00
Esa Korhonen
a350de1275 MXS-1703 Move MariaDBServer to its own file
generate_master_gtid_wait_cmd() is now a method of the Gtid-class.
2018-03-23 13:13:01 +02:00