From 352417b6364dc66bbeae7e9eddad25395d77c728 Mon Sep 17 00:00:00 2001 From: Bala Konda Reddy M Date: Wed, 13 May 2020 17:16:36 +0530 Subject: [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 --- glustolibs-gluster/glustolibs/gluster/gluster_base_class.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'glustolibs-gluster') diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py index 0d8731994..b07fe3ed5 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/*", -- cgit