Avoid unnecessary restart of replication master
Eliminates the unnecessary restart of the master site in a replication set when a new slave is added to a previously existing master site. Also removed some dead code. Change-Id: Ia76cca5cb084270c45ce782b7cecc3e17f8402d8 Closes-bug: #1368419
This commit is contained in:
parent
0f898f7861
commit
267a81625f
@ -845,6 +845,9 @@ class MySqlApp(object):
|
||||
if os.path.exists(cnf_file):
|
||||
utils.execute_with_timeout("sudo", "rm", cnf_file)
|
||||
|
||||
def exists_replication_source_overrides(self):
|
||||
return os.path.exists(MYCNF_REPLMASTER)
|
||||
|
||||
def write_replication_source_overrides(self, overrideValues):
|
||||
self._write_replication_overrides(overrideValues, MYCNF_REPLMASTER)
|
||||
|
||||
|
@ -108,10 +108,9 @@ class MysqlReplicationBase(base.Replication):
|
||||
return snapshot_id, log_position
|
||||
|
||||
def enable_as_master(self, service, master_config):
|
||||
if not master_config:
|
||||
master_config = self._get_master_config()
|
||||
service.write_replication_source_overrides(master_config)
|
||||
service.restart()
|
||||
if not service.exists_replication_source_overrides():
|
||||
service.write_replication_source_overrides(master_config)
|
||||
service.restart()
|
||||
|
||||
@abc.abstractmethod
|
||||
def connect_to_master(self, service, snapshot):
|
||||
|
Loading…
x
Reference in New Issue
Block a user