mha4mysql-manager
mha4mysql-manager copied to clipboard
Errant transaction need to be checked in GTID mode
Trying to fix https://code.google.com/p/mysql-master-ha/issues/detail?id=86 We need some check for errant transactions in masterha_check_repl, algorithm is in http://www.percona.com/blog/2014/05/19/errant-transactions-major-hurdle-for-gtid-based-failover-in-mysql-5-6/
+1
+2
:+1:
I think it's more important to prevent errand transactions. The best way to do this is with super_read_only
which is in PerconaServer/MariaDB (comes from webscalesql). look at mha-helper for implementation in MHA: https://github.com/grypyrg/mha-helper
Yep, super_read_only is nice, but it's not in upstream. Well, we switched to mysql-utilities based failover anyway...
mysql-utilities failover is a lot more limited than what MHA can do. It might work for you, but for many, it's just not good enough.
Hello @grypyrg, If you have no GTID - yep, then you have no choice (maybe you can use Pseudo-GTID and https://github.com/outbrain/orchestrator) but otherwise I see no other limitation, though. Of course, you need to write some wrapper around it, but it's not really complicated. From the point of current MySQL state (5.7) MHA looks quite outdated IMO.
MHA can ssh to all nodes including a mysqlbinlog stream
to fetch missing transactions from both binary and relay logs.
mysqlfailover
and/or mysqlrpladmin
only just changes the replication setup, it does not do anything like that.
IIRC if you using GTID - it will complete skipping all ssh stuff, it doesn't even check that -https://github.com/yoshinorim/mha4mysql-manager/blob/c6db3eb66dec214a68dd5e9a51be1cda4ff19c8d/lib/MHA/MasterMonitor.pm#L370-L389 So, if you using GTID everywhere - MHA is mostly overkill and easily can be replaced with mysql-utilities.
Yes, you're right in that.it skips most ssh stuff, but it does connect to binlog servers and get missing events from the masters binlog there (although buggy).
I submitted pull request https://github.com/yoshinorim/mha4mysql-manager/pull/110 which adds optional check for errant transactions prior to manual failover (masterha_master_switch
). If any are found, failover is aborted and a fix is suggested using mysqlslavetrx
with the list of relevant GTIDs. Hope this helps.
+1