summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-02-26 23:00:21 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-02-27 08:47:53 -0500
commitdbdfe6c353060b7af7b4250c8d6c30ed0c35783c (patch)
treebf098663c993798715d617823bb4a2b5cc269702 /xlators/mgmt
parentb5c26a462caf97bfc5380c81092f5c331ccaf1ae (diff)
glusterd: add portmap details in glusterd statedump
glusterd statedump file doesn't have information on the ports and its associated brick details. This is quite problematic if any setup ends up with stale ports and the only way to find the issue out is to gdb into the process which is always not available. This patch attempts to fill in this gap. Change-Id: I26b4fe753d752366ddf865ca3eeae3b4d577d555 BUG: 1426948 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/16764 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-statedump.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-statedump.c b/xlators/mgmt/glusterd/src/glusterd-statedump.c
index bfec854e7e7..7f806023566 100644
--- a/xlators/mgmt/glusterd/src/glusterd-statedump.c
+++ b/xlators/mgmt/glusterd/src/glusterd-statedump.c
@@ -187,6 +187,8 @@ glusterd_dump_priv (xlator_t *this)
{
glusterd_conf_t *priv = NULL;
char key[GF_DUMP_MAX_BUF_LEN] = {0,};
+ int port = 0;
+ struct pmap_registry *pmap = NULL;
GF_VALIDATE_OR_GOTO ("glusterd", this, out);
@@ -232,8 +234,28 @@ glusterd_dump_priv (xlator_t *this)
gf_proc_dump_build_key (key, "glusterd", "scrub.online");
gf_proc_dump_write (key, "%d", priv->scrub_svc.online);
+ /* Dump peer details */
GLUSTERD_DUMP_PEERS (&priv->peers, uuid_list, _gf_false);
+
+ /* Dump pmap data structure from base port to last alloc */
+ pmap = priv->pmap;
+ for (port = pmap->base_port; port <= pmap->last_alloc;
+ port++) {
+ gf_proc_dump_build_key (key, "glusterd", "pmap_port");
+ gf_proc_dump_write (key, "%d", port);
+ gf_proc_dump_build_key (key, "glusterd",
+ "pmap[%d].type", port);
+ gf_proc_dump_write (key, "%d", pmap->ports[port].type);
+ gf_proc_dump_build_key (key, "glusterd",
+ "pmap[%d].brickname", port);
+ gf_proc_dump_write (key, "%s",
+ pmap->ports[port].brickname);
+
+ }
+ /* Dump client details */
glusterd_dump_client_details (priv);
+
+ /* Dump mgmt_v3_lock from the dictionary if any */
glusterd_dict_mgmt_v3_lock_statedump(priv->mgmt_v3_lock);
dict_dump_to_statedump (priv->opts, "options", "glusterd");
}