diff options
| author | Kaushik BV <kaushikbv@gluster.com> | 2011-05-15 04:59:53 +0000 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-05-30 01:49:39 -0700 | 
| commit | f2d0baecfffe96231b52304ad0560c0697150fff (patch) | |
| tree | 118a525f619d22f4c17c3e100b78e3c54423514f /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | |
| parent | e1f79413774939bd23563b1d85b0c64a989301bc (diff) | |
mgmt/glusterd: Display a warning message to CLI in case of a corrupt geo-rep session
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2828 (gluster geo-rep stop should not show unsuccessful when the status is corrupt)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2828
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 31 | 
1 files changed, 31 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index d03200b4714..6dc6be593ff 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -818,6 +818,33 @@ out:          GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));          return ret;  } + +static int32_t +glusterd_append_gsync_status (dict_t *dst, dict_t *src) +{ +        int                ret = 0; +        char               *stop_msg = NULL; + +        ret = dict_get_str (src, "gsync-status", &stop_msg); +        if (ret) { +                ret = 0; +                goto out; +        } + +        ret = dict_set_dynstr (dst, "gsync-status", gf_strdup (stop_msg)); +        if (ret) { +                gf_log ("glusterd", GF_LOG_WARNING, "Unable to set the stop" +                        "message in the ctx dictionary"); +                goto out; +        } + +        ret = 0; + out: +        gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret); +        return ret; + +} +  static int32_t  glusterd_append_status_dicts (dict_t *dst, dict_t *src)  { @@ -908,6 +935,10 @@ glusterd_gsync_use_rsp_dict (dict_t *rsp_dict, char *op_errstr)                  ret = glusterd_append_status_dicts (ctx, rsp_dict);                  if (ret)                          goto out; + +                ret = glusterd_append_gsync_status (ctx, rsp_dict); +                if (ret) +                        goto out;          }          if (strcmp ("", op_errstr)) {                  ret = dict_set_dynstr (ctx, "errstr", gf_strdup(op_errstr));  | 
