Bug #81326 With MySQL 5.7 version, mysqlrpladmin fails to do switchover
Submitted: 5 May 2016 13:46 Modified: 14 Aug 2016 14:31
Reporter: Kunal Patil Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Utilities Severity:S1 (Critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[5 May 2016 13:46] Kunal Patil
Description:
Executing below command with mysql 5.7 db servers fails with an error as "ERROR: Query failed. 1054 (42S22): Unknown column 'password' in 'field list'"

Command :
mysqlrpladmin --master=%s --new-master=%s --slaves=%s switchover --force --demote-master --rpl-user=%s %s -v

This is happening because column name in mysql.user table is changed from 'password' to 'authentication_string'. 

How to repeat:
Execute mysqlrpladmin switchover command :

mysqlrpladmin --master=%s --new-master=%s --slaves=%s switchover --force --demote-master --rpl-user=%s %s -v

Suggested fix:
Making below changes in topology.py solved this issue :
Below topology.py is modified file and topology.py_orig is original file. 

[root@KP-HOST-40 common]# diff topology.py topology.py_orig
54c54
<                           'SET %s = PASSWORD("%s")'
---
>                           'SET password = PASSWORD("%s")'
57c57
< _SELECT_RPL_USER_PASS_QUERY = ('SELECT user, host, grant_priv, %s, '
---
> _SELECT_RPL_USER_PASS_QUERY = ('SELECT user, host, grant_priv, password, '
1686,1693d1685
<         version = self.master.get_version().split('.')
<         version_number = ".".join(version[:2])
<         #version_number = version[0]+"."+version[1]
<         if version_number == '5.7':
<            password_column = "authentication_string"
<         else:
<            password_column = "password"
<
1761c1753
<                                         (password_column, user, m_candidate.host))
---
>                                         (user, m_candidate.host))
1787c1779
<             self.master.exec_query(_UPDATE_RPL_USER_QUERY % (password_column, passwd, user))
---
>             self.master.exec_query(_UPDATE_RPL_USER_QUERY % (passwd, user))
[root@KP-HOST-40 common]#
[5 May 2016 13:52] Kunal Patil
Fix is as below: 

[root@KP-HOST-40 common]# diff topology.py topology.py_orig
54c54
<                           'SET %s = PASSWORD("%s")'
---
>                           'SET password = PASSWORD("%s")'
57c57
< _SELECT_RPL_USER_PASS_QUERY = ('SELECT user, host, grant_priv, %s, '
---
> _SELECT_RPL_USER_PASS_QUERY = ('SELECT user, host, grant_priv, password, '
1686,1692d1685
<         version = self.master.get_version().split('.')
<         version_number = ".".join(version[:2])
<         if version_number == '5.7':
<            password_column = "authentication_string"
<         else:
<            password_column = "password"
<
1760c1753
<                                         (password_column, user, m_candidate.host))
---
>                                         (user, m_candidate.host))
1786c1779
<             self.master.exec_query(_UPDATE_RPL_USER_QUERY % (password_column, passwd, user))
---
>             self.master.exec_query(_UPDATE_RPL_USER_QUERY % (passwd, user))
[22 Jun 2016 20:32] Aaron Lager
Looks like replication.py is also attempting to use the user.password column
[14 Jul 2016 14:31] Chuck Bell
This issue was fixed in release-1.6.2. Please try that version to verify.
[15 Aug 2016 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".