diff options
| author | hari gowtham <hgowtham@redhat.com> | 2015-11-24 10:31:35 +0530 | 
|---|---|---|
| committer | Atin Mukherjee <amukherj@redhat.com> | 2015-12-09 03:53:02 -0800 | 
| commit | 10d2b90770a09b283c7141c3c422a6349c0c30b4 (patch) | |
| tree | 3cd79e1967207a29f0236fe674fe3be5a51f64a3 | |
| parent | 2f4ec1dbfab7e43cd5404d5ebe6073f892541248 (diff) | |
glusterd:Removing error message in glusterd log during upgrade
        back port of : http://review.gluster.org/#/c/12766/
when one of the gluster node is upgraded to 3.7 from a lower
version and a mixed cluster is formed, tier related error
messages are displayed in the glusterd log which are removed
>Change-Id: I8d0fc43ce049990a6a52306317ea1298a0a91390
>BUG: 1282461
>Signed-off-by: hari gowtham <hgowtham@redhat.com>
>Reviewed-on: http://review.gluster.org/12587
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Change-Id: Id4df935795e145c5d98350b67b5a9d94419df558
BUG: 1287597
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
Reviewed-on: http://review.gluster.org/12851
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 49 | 
1 files changed, 38 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 9c0e5cc6ba6..7676513cc50 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -8053,6 +8053,8 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)          dict_t                          *ctx_dict = NULL;          char                            key[PATH_MAX] = {0,};          char                            *volname = NULL; +        glusterd_volinfo_t              *volinfo       = NULL; +          GF_ASSERT (rsp_dict); @@ -8145,27 +8147,52 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)                  goto out;          } -        ret = dict_get_int32 (rsp_dict, "hot_brick_count", &hot_brick_count); +        ret = dict_get_str (ctx_dict, "volname", &volname);          if (ret) { -                gf_msg (THIS->name, GF_LOG_ERROR, errno, -                        GD_MSG_DICT_GET_FAILED, -                        "Failed to get hot brick count from rsp_dict"); +                gf_msg (THIS->name, GF_LOG_ERROR, 0, +                        GD_MSG_DICT_SET_FAILED, +                        "Failed to get volname");                  goto out;          } -        ret = dict_set_int32 (ctx_dict, "hot_brick_count", hot_brick_count); +        ret = glusterd_volinfo_find (volname, &volinfo);          if (ret) { -                gf_msg (THIS->name, GF_LOG_ERROR, errno, -                        GD_MSG_DICT_SET_FAILED, -                        "Failed to update hot_brick_count"); +                gf_msg (THIS->name, GF_LOG_ERROR, 0, +                        GD_MSG_VOLINFO_GET_FAIL, +                        "Failed to get volinfo for volume: %s", +                        volname);                  goto out;          } -        ret = dict_get_int32 (rsp_dict, "type", &type); + +        if (volinfo->type == GF_CLUSTER_TYPE_TIER) { +                ret = dict_get_int32 (rsp_dict, "hot_brick_count", +                                      &hot_brick_count); +                if (ret) { +                        gf_msg (THIS->name, GF_LOG_ERROR, errno, +                                GD_MSG_DICT_GET_FAILED, +                                "Failed to get hot brick count from rsp_dict"); +                        goto out; +                } + + +                ret = dict_get_int32 (rsp_dict, "type", &type); +                if (ret) { +                        gf_msg (THIS->name, GF_LOG_ERROR, errno, +                                GD_MSG_DICT_GET_FAILED, +                                "Failed to get type from rsp_dict"); +                        goto out; +                } + + +        } + +        ret = dict_set_int32 (ctx_dict, "hot_brick_count", +                              hot_brick_count);          if (ret) {                  gf_msg (THIS->name, GF_LOG_ERROR, errno, -                        GD_MSG_DICT_GET_FAILED, -                        "Failed to get type from rsp_dict"); +                        GD_MSG_DICT_SET_FAILED, +                        "Failed to update hot_brick_count");                  goto out;          }  | 
