Merge "Avoid unnecessary restart of replication master"
This commit is contained in:
commit
01cd91427f
@ -845,6 +845,9 @@ class MySqlApp(object):
|
|||||||
if os.path.exists(cnf_file):
|
if os.path.exists(cnf_file):
|
||||||
utils.execute_with_timeout("sudo", "rm", 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):
|
def write_replication_source_overrides(self, overrideValues):
|
||||||
self._write_replication_overrides(overrideValues, MYCNF_REPLMASTER)
|
self._write_replication_overrides(overrideValues, MYCNF_REPLMASTER)
|
||||||
|
|
||||||
|
@ -108,10 +108,9 @@ class MysqlReplicationBase(base.Replication):
|
|||||||
return snapshot_id, log_position
|
return snapshot_id, log_position
|
||||||
|
|
||||||
def enable_as_master(self, service, master_config):
|
def enable_as_master(self, service, master_config):
|
||||||
if not master_config:
|
if not service.exists_replication_source_overrides():
|
||||||
master_config = self._get_master_config()
|
service.write_replication_source_overrides(master_config)
|
||||||
service.write_replication_source_overrides(master_config)
|
service.restart()
|
||||||
service.restart()
|
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def connect_to_master(self, service, snapshot):
|
def connect_to_master(self, service, snapshot):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user