Description:
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:
------
#!/bin/bash
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'