summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-locks.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2014-09-04 21:47:50 +0530
committerKaushal M <kaushal@redhat.com>2014-10-15 03:02:40 -0700
commit6c13daed1d601df76cfd1973d3ce800afa877fd2 (patch)
treedd739590b1b07d49c04f1da658b779b2f3e81922 /xlators/mgmt/glusterd/src/glusterd-locks.c
parent7e8eefca2caaaa61e1b31b747384f660c595d9c9 (diff)
glusterd: statedump support
Although glusterd currently has statedump support but it doesn't dump its context information. Implementing glusterd_dump_priv function to export per-node glusterd information would be useful for debugging bugs. Once implemented, we could enhance sos-report to fetch this information. This would potentially reduce our time to root cause and data needed for debugability can be dumped gradually. Following is the main items of the dump list targeted in this patch : * Supported max/min op-version and current op-version * Information about peer list * Information about peer list involved while a transaction is going on (xaction_peers) * option dictionary in glusterd_conf_t * mgmt_v3_lock in glusterd_conf_t * List of connected clients * uuid of glusterd * A section of rpc related information like live connections and their statistics There are couple of issues which were found during implementation and testing phase: - xaction_peers of glusterd_conf_t was not initialized in init because of which traversing through this list head was crashing when there was no active transaction - gf_free was not setting the typestr to NULL if the the alloc count becomes 0 for a mem-type earlier allocated. Change-Id: Ic9bce2d57682fc1771cd2bc6af0b7316ecbc761f BUG: 1139682 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/8665 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-locks.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-locks.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-locks.c b/xlators/mgmt/glusterd/src/glusterd-locks.c
index b2629fd87b8..1f1de2ae4f0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-locks.c
+++ b/xlators/mgmt/glusterd/src/glusterd-locks.c
@@ -661,6 +661,18 @@ glusterd_mgmt_v3_unlock (const char *name, uuid_t uuid, char *type)
/* Removing the mgmt_v3 lock from the global list */
dict_del (priv->mgmt_v3_lock, key);
+ /* Remove the backtrace key as well */
+ ret = snprintf (key, sizeof(key), "debug.last-success-bt-%s-%s", name,
+ type);
+ if (ret != strlen ("debug.last-success-bt-") + strlen (name) +
+ strlen (type) + 1) {
+ gf_log (this->name, GF_LOG_ERROR, "Unable to create backtrace "
+ "key");
+ ret = -1;
+ goto out;
+ }
+ dict_del (priv->mgmt_v3_lock, key);
+
gf_log (this->name, GF_LOG_DEBUG,
"Lock for %s %s successfully released",
type, name);