Unsuccessful controller fs resizing without error indication
This commit ensures that if resizing a drbd filesystem is not successful the filesystem state will stay in "drbd_fs_resizing_in_progress" state and the "controller configuration is out-of-date" alarm won't be cleared. Change-Id: I9a655c4a97836b921b63f10fc425eebfbb5af17a Closes-Bug: 1812235 Signed-off-by: Wei Zhou <wei.zhou@windriver.com>
This commit is contained in:
parent
c3f905276d
commit
0bc78c4c44
|
@ -7461,6 +7461,7 @@ class ConductorManager(service.PeriodicService):
|
||||||
|
|
||||||
progress = ""
|
progress = ""
|
||||||
retry_attempts = 3
|
retry_attempts = 3
|
||||||
|
rc = False
|
||||||
with open(os.devnull, "w"):
|
with open(os.devnull, "w"):
|
||||||
try:
|
try:
|
||||||
if standby_host:
|
if standby_host:
|
||||||
|
@ -7490,35 +7491,38 @@ class ConductorManager(service.PeriodicService):
|
||||||
drbd_fs_updated = self._drbd_fs_updated(context)
|
drbd_fs_updated = self._drbd_fs_updated(context)
|
||||||
if drbd_fs_updated:
|
if drbd_fs_updated:
|
||||||
while(loop_timeout <= 5):
|
while(loop_timeout <= 5):
|
||||||
if (not pgsql_resized and
|
if constants.DRBD_PGSQL in drbd_fs_updated:
|
||||||
(not standby_host or (standby_host and
|
if (not pgsql_resized and
|
||||||
constants.DRBD_PGSQL in self._drbd_fs_sync()))):
|
(not standby_host or (standby_host and
|
||||||
# database_gib /var/lib/postgresql
|
constants.DRBD_PGSQL in self._drbd_fs_sync()))):
|
||||||
progress = "resize2fs drbd0"
|
# database_gib /var/lib/postgresql
|
||||||
cmd = ["resize2fs", "/dev/drbd0"]
|
progress = "resize2fs drbd0"
|
||||||
stdout, __ = cutils.execute(*cmd, attempts=retry_attempts, run_as_root=True)
|
cmd = ["resize2fs", "/dev/drbd0"]
|
||||||
LOG.info("Performed %s" % progress)
|
stdout, __ = cutils.execute(*cmd, attempts=retry_attempts, run_as_root=True)
|
||||||
pgsql_resized = True
|
LOG.info("Performed %s" % progress)
|
||||||
|
pgsql_resized = True
|
||||||
|
|
||||||
if (not cgcs_resized and
|
if constants.DRBD_CGCS in drbd_fs_updated:
|
||||||
(not standby_host or (standby_host and
|
if (not cgcs_resized and
|
||||||
constants.DRBD_CGCS in self._drbd_fs_sync()))):
|
(not standby_host or (standby_host and
|
||||||
# cgcs_gib /opt/cgcs
|
constants.DRBD_CGCS in self._drbd_fs_sync()))):
|
||||||
progress = "resize2fs drbd3"
|
# cgcs_gib /opt/cgcs
|
||||||
cmd = ["resize2fs", "/dev/drbd3"]
|
progress = "resize2fs drbd3"
|
||||||
stdout, __ = cutils.execute(*cmd, attempts=retry_attempts, run_as_root=True)
|
cmd = ["resize2fs", "/dev/drbd3"]
|
||||||
LOG.info("Performed %s" % progress)
|
stdout, __ = cutils.execute(*cmd, attempts=retry_attempts, run_as_root=True)
|
||||||
cgcs_resized = True
|
LOG.info("Performed %s" % progress)
|
||||||
|
cgcs_resized = True
|
||||||
|
|
||||||
if (not extension_resized and
|
if constants.DRBD_EXTENSION in drbd_fs_updated:
|
||||||
(not standby_host or (standby_host and
|
if (not extension_resized and
|
||||||
constants.DRBD_EXTENSION in self._drbd_fs_sync()))):
|
(not standby_host or (standby_host and
|
||||||
# extension_gib /opt/extension
|
constants.DRBD_EXTENSION in self._drbd_fs_sync()))):
|
||||||
progress = "resize2fs drbd5"
|
# extension_gib /opt/extension
|
||||||
cmd = ["resize2fs", "/dev/drbd5"]
|
progress = "resize2fs drbd5"
|
||||||
stdout, __ = cutils.execute(*cmd, attempts=retry_attempts, run_as_root=True)
|
cmd = ["resize2fs", "/dev/drbd5"]
|
||||||
LOG.info("Performed %s" % progress)
|
stdout, __ = cutils.execute(*cmd, attempts=retry_attempts, run_as_root=True)
|
||||||
extension_resized = True
|
LOG.info("Performed %s" % progress)
|
||||||
|
extension_resized = True
|
||||||
|
|
||||||
if constants.DRBD_PATCH_VAULT in drbd_fs_updated:
|
if constants.DRBD_PATCH_VAULT in drbd_fs_updated:
|
||||||
if (not patch_resized and
|
if (not patch_resized and
|
||||||
|
@ -7572,12 +7576,14 @@ class ConductorManager(service.PeriodicService):
|
||||||
all_resized = False
|
all_resized = False
|
||||||
|
|
||||||
if all_resized:
|
if all_resized:
|
||||||
|
LOG.info("resizing filesystems completed")
|
||||||
|
rc = True
|
||||||
break
|
break
|
||||||
|
|
||||||
loop_timeout += 1
|
loop_timeout += 1
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
else:
|
||||||
LOG.info("resizing filesystems completed")
|
LOG.warn("resizing filesystems not completed")
|
||||||
|
|
||||||
except exception.ProcessExecutionError as ex:
|
except exception.ProcessExecutionError as ex:
|
||||||
LOG.warn("Failed to perform storage resizing (cmd: '%(cmd)s', "
|
LOG.warn("Failed to perform storage resizing (cmd: '%(cmd)s', "
|
||||||
|
@ -7586,7 +7592,7 @@ class ConductorManager(service.PeriodicService):
|
||||||
{"cmd": " ".join(cmd), "stdout": ex.stdout,
|
{"cmd": " ".join(cmd), "stdout": ex.stdout,
|
||||||
"stderr": ex.stderr, "rc": ex.exit_code})
|
"stderr": ex.stderr, "rc": ex.exit_code})
|
||||||
|
|
||||||
return True
|
return rc
|
||||||
|
|
||||||
# Retry in case of errors or racing issues with rmon autoextend. Rmon is pooling at
|
# Retry in case of errors or racing issues with rmon autoextend. Rmon is pooling at
|
||||||
# 10s intervals and autoextend is fast. Therefore retrying a few times and waiting
|
# 10s intervals and autoextend is fast. Therefore retrying a few times and waiting
|
||||||
|
|
Loading…
Reference in New Issue