31 Commits

Author SHA1 Message Date
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
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
Esa Korhonen
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
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
370b3be576 MXS-1703 Support "Preparing" in Slave_IO_Running
Is interpreted as "Connecting".
2018-05-09 12:49:23 +03:00
Esa Korhonen
0c5af4b13f Merge branch '2.2' into develop 2018-05-08 14:10:52 +03:00
Markus Mäkelä
3030799ae1
Fix GTID updating for slaves
The updating of GTIDs was only considered successful if both the current
GTID position and binlog GTID positions were non-empty. If a slave has no
binlogged events, the GTID update would always fail.

This change in behavior caused the mysqlmon_failover_auto and
mysqlmon_failver_manual tests to break. The test disabled the binary log
on one of the servers which caused it to be left out from the rejoining
process.
2018-05-03 09:46:45 +03:00
Esa Korhonen
5d010ff712 Cleanup SERVER struct
Removed one unused field. Rearranged others, clarified comments.
2018-04-27 10:48:56 +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
7f36339f53 MXS-1703 Better strtoll() & strtoull() error detection
The functions do not set errno on all invalid input, so it's best to check
endptr.

Also, strtoll is now used for server id scanning through QueryResult.
2018-04-12 13:06:36 +03:00
Esa Korhonen
8b642dbb5e MXS-1703 Rename typedefs in preparation for more changes
Also moved some code around.
2018-04-09 10:55:55 +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