summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2017-12-27 23:15:37 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-12-29 09:49:40 +0000
commite126368f6b5231fb2acf307fbd8e343e52d61885 (patch)
tree40d7c582004e82259496e2519a4979b97748a5a9 /xlators
parentd3cfd8dc8f7b774a8b081098f11237ebfa60156e (diff)
snapshot : after brick reset/replace snapshot creation fails
Problem : after brick reset/replace snapshot creation fails Solution : During brick reset/replace when we validate and aggrigate dictionary data from another node it was rewriting 'mount_dir' value to NULL which is critical for snapshot creation. Change-Id: Iabefbfcef7d8ac4cbd2a241e821c0e51492c093e BUG: 1512451 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c30
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-reset-brick.c27
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
3 files changed, 39 insertions, 27 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index f282c328387..3e144f63706 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -309,16 +309,28 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
/* A bricks mount dir is required only by snapshots which were
* introduced in gluster-3.6.0
*/
- ret = glusterd_get_brick_mount_dir (dst_brickinfo->path,
- dst_brickinfo->hostname,
- dst_brickinfo->mount_dir);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- GD_MSG_BRICK_MOUNTDIR_GET_FAIL,
- "Failed to get brick mount_dir");
- goto out;
- }
+ if (!(gf_uuid_compare (dst_brickinfo->uuid, MY_UUID))) {
+ ret = glusterd_get_brick_mount_dir
+ (dst_brickinfo->path,
+ dst_brickinfo->hostname,
+ dst_brickinfo->mount_dir);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_BRICK_MOUNTDIR_GET_FAIL,
+ "Failed to get brick mount_dir");
+ goto out;
+ }
+ ret = dict_set_dynstr_with_alloc
+ (rsp_dict, "brick1.mount_dir",
+ dst_brickinfo->mount_dir);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_DICT_SET_FAILED,
+ "Failed to set brick.mount_dir");
+ goto out;
+ }
+ }
ret = dict_set_int32 (rsp_dict, "brick_count", 1);
if (ret) {
diff --git a/xlators/mgmt/glusterd/src/glusterd-reset-brick.c b/xlators/mgmt/glusterd/src/glusterd-reset-brick.c
index 10ee6f4ef62..c1de0432a73 100644
--- a/xlators/mgmt/glusterd/src/glusterd-reset-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-reset-brick.c
@@ -197,15 +197,24 @@ glusterd_reset_brick_prevalidate (dict_t *dict, char **op_errstr,
}
- ret = glusterd_get_brick_mount_dir
- (dst_brickinfo->path,
- dst_brickinfo->hostname,
- dst_brickinfo->mount_dir);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- GD_MSG_BRICK_MOUNTDIR_GET_FAIL,
- "Failed to get brick mount_dir.");
- goto out;
+ if (!(gf_uuid_compare (dst_brickinfo->uuid, MY_UUID))) {
+ ret = glusterd_get_brick_mount_dir (dst_brickinfo->path,
+ dst_brickinfo->hostname,
+ dst_brickinfo->mount_dir);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_BRICK_MOUNTDIR_GET_FAIL,
+ "Failed to get brick mount_dir");
+ goto out;
+ }
+ ret = dict_set_dynstr_with_alloc (rsp_dict, "brick1.mount_dir",
+ dst_brickinfo->mount_dir);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_DICT_SET_FAILED,
+ "Failed to set brick.mount_dir");
+ goto out;
+ }
}
ret = dict_set_int32 (rsp_dict, "brick_count", 1);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 065f6daecd6..ed4ce94dba1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -13976,15 +13976,6 @@ glusterd_brick_op_prerequisites (dict_t *dict,
(*src_brickinfo)->port);
}
}
- /* setting mount_dir */
- ret = dict_set_dynstr_with_alloc (rsp_dict, "brick1.mount_dir",
- (*src_brickinfo)->mount_dir);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- GD_MSG_DICT_SET_FAILED,
- "Failed to set brick1.mount_dir");
- goto out;
- }
v = *volinfo;
b = *src_brickinfo;