Bug #78746 | mysqlrpladmin switchover does not change the read_only setting | ||
---|---|---|---|
Submitted: | 8 Oct 2015 3:27 | Modified: | 22 Nov 2016 10:27 |
Reporter: | monty solomon | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Utilities | Severity: | S1 (Critical) |
Version: | 1.5.6 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[8 Oct 2015 3:27]
monty solomon
[8 Oct 2015 4:24]
monty solomon
The following statement in set_read_only() is missing parentheses return self.exec_query("SET @@GLOBAL.READ_ONLY = %s" % "ON" if on else "OFF") It should read return self.exec_query("SET @@GLOBAL.READ_ONLY = %s" % ("ON" if on else "OFF"))
[8 Oct 2015 4:37]
monty solomon
The code sets the master to be read-only then it stops all the slaves and then it erroneously sets the master to be read-write again. The master should stay blocked and read-only. Only if the master is demoted and connected as a slave to the promoted master should it be set to read-write again. lock_ftwrl = Lock(self.master, [], lock_options) self.master.set_read_only(True) ... # Stop all slaves self._report("# Stopping slaves.") self.run_cmd_on_slaves("stop", not self.verbose) # Unblock master self.master.set_read_only(False) lock_ftwrl.unlock()
[8 Oct 2015 4:41]
monty solomon
The code to demote the master does not change the read-only setting on the demoted master. It may assume that demoted master was left in a read-only state.
[8 Oct 2015 5:08]
monty solomon
The code does not set the promoted master to be read/write. The failover() method should be checked to make sure it does not have similar issues.
[3 Nov 2016 10:53]
Flex Gao
Still has this problem on 1.6.4
[22 Nov 2016 10:27]
Chiranjeevi Battula
Hello monty solomon, Thank you for the bug report. This is most likely duplicate of Bug #76522, please see Bug #76522. Thanks, Chiranjeevi.