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