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