17b94a
From 0cd08d9e89f5ee86d5f4f90f0ca5c07bd290636c Mon Sep 17 00:00:00 2001
17b94a
From: Sanju Rakonde <srakonde@redhat.com>
17b94a
Date: Fri, 26 Apr 2019 22:28:53 +0530
17b94a
Subject: [PATCH 125/141] glusterd: define dumpops in the xlator_api of
17b94a
 glusterd
17b94a
17b94a
Problem: statedump is not capturing information related to glusterd
17b94a
17b94a
Solution: statdump is not capturing glusterd info because
17b94a
trav->dumpops is null in gf_proc_dump_single_xlator_info ()
17b94a
where trav is glusterd xlator object. trav->dumpops is null
17b94a
because we missed to define dumpops in xlator_api of glusterd.
17b94a
defining dumpops in xlator_api of glusterd fixes the issue.
17b94a
17b94a
> fixes: bz#1703629
17b94a
> Change-Id: If85429ecb1ef580aced8d5b88d09fc15258bfc4c
17b94a
> Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
17b94a
17b94a
upstream patch: https://review.gluster.org/#/c/glusterfs/+/22640/
17b94a
17b94a
BUG: 1703753
17b94a
Change-Id: If85429ecb1ef580aced8d5b88d09fc15258bfc4c
17b94a
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/169207
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
17b94a
---
17b94a
 tests/bugs/glusterd/optimized-basic-testcases.t | 13 +++++++++++++
17b94a
 xlators/mgmt/glusterd/src/glusterd.c            |  1 +
17b94a
 2 files changed, 14 insertions(+)
17b94a
17b94a
diff --git a/tests/bugs/glusterd/optimized-basic-testcases.t b/tests/bugs/glusterd/optimized-basic-testcases.t
17b94a
index dd98a65..d700b5e 100644
17b94a
--- a/tests/bugs/glusterd/optimized-basic-testcases.t
17b94a
+++ b/tests/bugs/glusterd/optimized-basic-testcases.t
17b94a
@@ -32,6 +32,16 @@ function get_brick_host_uuid()
17b94a
     echo $host_uuid_list | awk '{print $1}'
17b94a
 }
17b94a
 
17b94a
+function generate_statedump_and_check_for_glusterd_info {
17b94a
+        pid=`pidof glusterd`
17b94a
+        #remove old stale statedumps
17b94a
+        cleanup_statedump $pid
17b94a
+        kill -USR1 $pid
17b94a
+        #Wait till the statedump is generated
17b94a
+        sleep 1
17b94a
+        fname=$(ls $statedumpdir | grep -E "\.$pid\.dump\.")
17b94a
+        cat $statedumpdir/$fname | grep "xlator.glusterd.priv" | wc -l
17b94a
+}
17b94a
 
17b94a
 cleanup;
17b94a
 
17b94a
@@ -279,4 +289,7 @@ mkdir -p /xyz/var/lib/glusterd/abc
17b94a
 TEST  $CLI volume create "test" $H0:/xyz/var/lib/glusterd/abc
17b94a
 EXPECT 'Created' volinfo_field "test" 'Status';
17b94a
 
17b94a
+EXPECT "1" generate_statedump_and_check_for_glusterd_info
17b94a
+
17b94a
+cleanup_statedump `pidof glusterd`
17b94a
 cleanup
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
17b94a
index d4ab630..c0973cb 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd.c
17b94a
@@ -2231,6 +2231,7 @@ xlator_api_t xlator_api = {
17b94a
     .fini = fini,
17b94a
     .mem_acct_init = mem_acct_init,
17b94a
     .op_version = {1}, /* Present from the initial version */
17b94a
+    .dumpops = &dumpops,
17b94a
     .fops = &fops,
17b94a
     .cbks = &cbks,
17b94a
     .options = options,
17b94a
-- 
17b94a
1.8.3.1
17b94a