summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs
diff options
context:
space:
mode:
authorBala Konda Reddy M <bala12352@gmail.com>2020-05-13 17:16:36 +0530
committerBala Konda Reddy M <bala12352@gmail.com>2020-05-15 06:45:34 +0000
commit352417b6364dc66bbeae7e9eddad25395d77c728 (patch)
tree3c41865991e4b3f43baa010bd17552bbc654a2ec /glustolibs-gluster/glustolibs
parenta158bc4faf125108396c282784607dcf73027de2 (diff)
[Libfix] Kill stale bricks in scratch_cleanup
Problem: While performing scratch clenaup, observerd posix health checkers warnings once the glusterd is started as shown below [2020-05-05 12:19:10.633623] M [MSGID: 113075] [posix-helpers.c:2194:posix_health_check_thread_proc] 0-testvol_distributed-dispersed-posix: health-check failed, going down Solution: In scartch cleanup, once the glusterd is stopped, and runtime socket file removed for glusterd daemon, there are stale glusterfsd present on few the machines. Adding a step to get glusterfsd processes if any and using kill_process method killing the stale glusterfsd processes and continuing with the existing procedure. Once the glusterd is started won't see any posix health checkers. Change-Id: Ib3e9492ec029b5c9efd1c07b4badc779375a66d6 Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/gluster_base_class.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
index 0d87319..b07fe3e 100644
--- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
+++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
@@ -59,6 +59,7 @@ from glustolibs.gluster.volume_ops import (
set_volume_options, volume_reset, volume_start)
from glustolibs.io.utils import log_mounts_info
from glustolibs.gluster.geo_rep_libs import setup_master_and_slave_volumes
+from glustolibs.misc.misc_libs import kill_process
class runs_on(g.CarteTestClass):
@@ -268,6 +269,14 @@ class GlusterBaseClass(TestCase):
g.log.error("Failed to stop glusterd")
return False
for server in cls.servers:
+ ret, out, _ = g.run(server, "pgrep glusterfsd", "root")
+ if not ret:
+ ret = kill_process(server,
+ process_ids=out.strip().split('\n'))
+ if not ret:
+ g.log.error("Unable to kill process {}".format(
+ out.strip().split('\n')))
+ return False
cmd_list = ("rm -rf /var/lib/glusterd/vols/*",
"rm -rf /var/lib/glusterd/snaps/*",
"rm -rf /var/lib/glusterd/peers/*",