mha4mysql-manager icon indicating copy to clipboard operation
mha4mysql-manager copied to clipboard

Errant transaction need to be checked in GTID mode

Open deniszh opened this issue 10 years ago • 12 comments

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/

deniszh avatar Nov 13 '14 09:11 deniszh

+1

brutto avatar Mar 19 '15 18:03 brutto

+2

bogdanov1609 avatar Oct 20 '15 14:10 bogdanov1609

:+1:

surpr1ze avatar Oct 20 '15 15:10 surpr1ze

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

grypyrg avatar Dec 07 '15 12:12 grypyrg

Yep, super_read_only is nice, but it's not in upstream. Well, we switched to mysql-utilities based failover anyway...

deniszh avatar Dec 07 '15 14:12 deniszh

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.

grypyrg avatar Dec 07 '15 20:12 grypyrg

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.

deniszh avatar Dec 07 '15 20:12 deniszh

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.

grypyrg avatar Dec 08 '15 07:12 grypyrg

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.

deniszh avatar Dec 08 '15 09:12 deniszh

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).

grypyrg avatar Dec 08 '15 15:12 grypyrg

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.

LaurentKol avatar Jun 18 '18 01:06 LaurentKol

+1

nuzayats avatar Mar 01 '19 08:03 nuzayats