diff options
| author | Krishnan Parthasarathi <kparthas@redhat.com> | 2014-09-03 11:03:06 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-24 00:00:56 -0700 | 
| commit | 49782abc2f925ffcbd3148b8db851237e693d018 (patch) | |
| tree | 41cc1edc6cd36fb380c5a4db1eabefa6c30806ca /xlators | |
| parent | b0f98446d5b465c3fc88569396fe3c6b5793aed5 (diff) | |
glusterd: Add last successful glusterd lock backtrace
Also, moved the backtrace fetching logic to a separate function.
Modified the backtrace fetching logic able to work under memory pressure
conditions.
Change-Id: Ie38bea425a085770f41831314aeda95595177ece
BUG:1145093
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/8794
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-locks.c | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-locks.c b/xlators/mgmt/glusterd/src/glusterd-locks.c index 28358aa555e..53c97bea533 100644 --- a/xlators/mgmt/glusterd/src/glusterd-locks.c +++ b/xlators/mgmt/glusterd/src/glusterd-locks.c @@ -491,6 +491,7 @@ out:          return ret;  } +  int32_t  glusterd_mgmt_v3_lock (const char *name, uuid_t uuid, char *type)  { @@ -501,6 +502,7 @@ glusterd_mgmt_v3_lock (const char *name, uuid_t uuid, char *type)          gf_boolean_t                    is_valid        = _gf_true;          uuid_t                          owner           = {0};          xlator_t                       *this            = NULL; +        char                           *bt              = NULL;          this = THIS;          GF_ASSERT (this); @@ -568,6 +570,18 @@ glusterd_mgmt_v3_lock (const char *name, uuid_t uuid, char *type)                  goto out;          } +        /* Saving the backtrace into the pre-allocated buffer, ctx->btbuf*/ +        if ((bt = gf_backtrace_save (NULL))) { +                snprintf (key, sizeof (key), "debug.last-success-bt-%s-%s", +                          name, type); +                ret = dict_set_dynstr_with_alloc (priv->mgmt_v3_lock, key, bt); +                if (ret) +                        gf_log (this->name, GF_LOG_WARNING, "Failed to save " +                                "the back trace for lock %s-%s granted to %s", +                                name, type, uuid_utoa (uuid)); +                ret = 0; +        } +          gf_log (this->name, GF_LOG_DEBUG,                  "Lock for %s %s successfully held by %s",                  type, name, uuid_utoa (uuid));  | 
