Add SST sync detection
This allows us to make a bit more sane mysql start time timeout Change-Id: I5c071a5f4e0112d6e9b0bf4a8e6901c70dcd4adf
This commit is contained in:
parent
168ad0d266
commit
1db76f7d4e
|
@ -102,7 +102,7 @@ class GaleraChecker(object):
|
||||||
|
|
||||||
def check_if_sst_running(self):
|
def check_if_sst_running(self):
|
||||||
|
|
||||||
return True if os.path.isfile(SST_FLAG) else False
|
return os.path.isfile(SST_FLAG)
|
||||||
|
|
||||||
def check_if_pidfile_created(self):
|
def check_if_pidfile_created(self):
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ DATADIR = "/var/lib/mysql"
|
||||||
INIT_FILE = os.path.join(DATADIR, 'init.ok')
|
INIT_FILE = os.path.join(DATADIR, 'init.ok')
|
||||||
PID_FILE = os.path.join(DATADIR, "mysqld.pid")
|
PID_FILE = os.path.join(DATADIR, "mysqld.pid")
|
||||||
GRASTATE_FILE = os.path.join(DATADIR, 'grastate.dat')
|
GRASTATE_FILE = os.path.join(DATADIR, 'grastate.dat')
|
||||||
|
SST_FLAG = os.path.join(DATADIR, "sst_in_progress")
|
||||||
GLOBALS_PATH = '/etc/ccp/globals/globals.json'
|
GLOBALS_PATH = '/etc/ccp/globals/globals.json'
|
||||||
|
|
||||||
LOG_DATEFMT = "%Y-%m-%d %H:%M:%S"
|
LOG_DATEFMT = "%Y-%m-%d %H:%M:%S"
|
||||||
|
@ -320,6 +321,11 @@ def check_for_stale_seqno(etcd_client):
|
||||||
queue_set, seqno_set)
|
queue_set, seqno_set)
|
||||||
|
|
||||||
|
|
||||||
|
def check_if_sst_running():
|
||||||
|
|
||||||
|
return os.path.isfile(SST_FLAG)
|
||||||
|
|
||||||
|
|
||||||
def wait_for_expected_state(etcd_client, ttl):
|
def wait_for_expected_state(etcd_client, ttl):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
@ -470,7 +476,16 @@ def wait_for_mysqld(proc):
|
||||||
def wait_for_mysqld_to_start(proc, insecure):
|
def wait_for_mysqld_to_start(proc, insecure):
|
||||||
|
|
||||||
LOG.info("Waiting mysql to start...")
|
LOG.info("Waiting mysql to start...")
|
||||||
for i in range(0, 299):
|
time.sleep(5)
|
||||||
|
while True:
|
||||||
|
if check_if_sst_running():
|
||||||
|
LOG.debug("SST sync detected, waiting...")
|
||||||
|
time.sleep(30)
|
||||||
|
else:
|
||||||
|
LOG.debug("No SST sync detected")
|
||||||
|
break
|
||||||
|
|
||||||
|
for i in range(0, 59):
|
||||||
try:
|
try:
|
||||||
mysql_client = get_mysql_client(insecure=insecure)
|
mysql_client = get_mysql_client(insecure=insecure)
|
||||||
mysql_exec(mysql_client, [("SELECT 1", None)])
|
mysql_exec(mysql_client, [("SELECT 1", None)])
|
||||||
|
|
Loading…
Reference in New Issue