Bug #81997 mysqlfailover args passed to --exec-after script don't match the docs
Submitted: 24 Jun 2016 10:19 Modified: 16 Sep 2016 5:28
Reporter: David Norman Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Utilities Severity:S3 (Non-critical)
Version:1.6.3 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqlfailover

[24 Jun 2016 10:19] David Norman
I believe that the docs for --exec-after in 'Table 5.2 External Script Parameters' are wrong.  It appears that the script is run with 4 parameters: <old host> <old port> <new host> <new port>.   This is true in the GTID case.

Looking at the code (topology.py), the case where the system is GTID is handled by a function called 'failover', which passes 4 parameters to the script (line 2228 in the version I am looking at - search for 'exec_after' or 'after_script').   In the non-GTID case, handled by the function 'switchover', the script is passed 2 arguments, in line with the documentation.

How to repeat:
set up the mysqlfailover script to monitor a master and slave that are set to use GTID replication.  use the --exec-after option to make a script run.  have that script display the count and values of its arguments. Something like:

echo "args $# $@" > /tmp/script.out


kill off the master server and observe the output of the script in /tmp/script.out and then compare to the documentation that states that the script has only 2 arguments passed.

Suggested fix:
fix topology.py so that it has the same arguments as the docs.  function is 'failover'
[16 Sep 2016 5:28] Chiranjeevi Battula
Hello David Norman,

Thank you for the bug report.
This is most likely duplicate of Bug #79175, please see Bug #79175.