diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2017-02-26 23:00:21 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-03-03 10:13:06 -0500 |
commit | 9b95b1e82fa722d92ef1259495fce386833e6f15 (patch) | |
tree | 89ab919348d177ef3c5ef011df759add414fb37b /xlators/mgmt | |
parent | e99b00310277fbc2b85d2a7567c748ec14b69290 (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.
>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>
>(cherry picked from commit dbdfe6c353060b7af7b4250c8d6c30ed0c35783c)
Change-Id: I26b4fe753d752366ddf865ca3eeae3b4d577d555
BUG: 1427399
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://review.gluster.org/16779
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-statedump.c | 22 |
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"); } |