Bug #80193 mysqlrpladmin failover does not properly detect master
Submitted: 28 Jan 2016 20:41 Modified: 19 Jun 2018 16:27
Reporter: monty solomon Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Utilities Severity:S3 (Non-critical)
Version:1.5.6 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[28 Jan 2016 20:41] monty solomon
Description:
The mysqlrpladmin failover command does not properly detect the master in the candidates list and uses it as the new master.

How to repeat:
Run a failover with the master server in the slaves list and in the candidates list and confirm that it aborts.

For example, with damp-bonus as the master

mysqlrpladmin failover --slaves=damp-bonus,dry-mountain,winter-rice,green-bar,wandering-field,billowing-rice --candidates=damp-bonus,dry-mountain,winter-rice,green-bar,wandering-field,billowing-rice

# Checking privileges.
# Checking privileges on candidates.
# Performing failover.
# Checking eligibility of slave damp-bonus:3306 for candidate.
#   GTID_MODE=ON ... Ok
WARNING: IP lookup by name failed for damp-bonus,reason: Resolver Error 0 (no error)
#   Replication user exists ... Ok
# Candidate slave damp-bonus:3306 will become the new master.
# Checking slaves status (before failover).
# ERROR: Server 'damp-bonus@3306' is not acting as a slave.
ERROR: Server 'damp-bonus@3306' is not acting as a slave. Note: To ignore this issue use the utility with the --force option.

Run a failover with the master in the candidates list but not in the slaves list and observe that it does not abort.

For example, with damp-bonus as the master

mysqlrpladmin failover --slaves=shrill-band,dry-mountain,winter-rice,green-bar,wandering-field,billowing-rice --candidates=damp-bonus,dry-mountain,winter-rice,green-bar,wandering-field,billowing-rice

# Checking privileges.
# Checking privileges on candidates.
# Performing failover.
# Checking eligibility of slave damp-bonus:3306 for candidate.
#   GTID_MODE=ON ... Ok
WARNING: IP lookup by name failed for damp-bonus,reason: Resolver Error 0 (no error)
#   Replication user exists ... Ok
# Candidate slave damp-bonus:3306 will become the new master.
# Checking slaves status (before failover).
# Preparing candidate for failover.
…

Suggested fix:
Option to consider

* check for the master in the candidates validation code similar to the check in the slaves validation code

* compare the slaves list with the candidates list and make sure the candidates list is a subset of the slaves list

* don't use any candidates that are not on the slaves list
[19 May 2018 16:27] MySQL Verification Team
Hi,

I'm not sure I understand why do you believe this is a bug?

What did you expect to happen in the first try (where you listed your master as slave)? And what did you expect in the second try?

all best
Bogdan
[20 Jun 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".