summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2013-03-05 14:11:02 +0530
committerVijay Bellur <vbellur@redhat.com>2013-04-12 05:59:05 -0700
commitc88fa6d979900e7ee32bd13445bcf4a1dcf3f617 (patch)
tree1ba36d79e8ff6aed9c32eb5a7e90def179589488 /xlators
parentf8aa31c1eb5abefbf8782dd2b2d05782205229b8 (diff)
glusterd: Fixed volume-sync in synctask codepath.
Change-Id: I2911d3ac80825310f84c5ba6bd7890e65e1ee219 BUG: 950048 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/4643 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index 1deb15d5e2f..3249dbc006c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -613,7 +613,8 @@ out:
}
int
-gd_build_peers_list (struct list_head *peers, struct list_head *xact_peers)
+gd_build_peers_list (struct list_head *peers, struct list_head *xact_peers,
+ glusterd_op_t op)
{
glusterd_peerinfo_t *peerinfo = NULL;
int npeers = 0;
@@ -621,7 +622,8 @@ gd_build_peers_list (struct list_head *peers, struct list_head *xact_peers)
list_for_each_entry (peerinfo, peers, uuid_list) {
if (!peerinfo->connected)
continue;
- if (peerinfo->state.state != GD_FRIEND_STATE_BEFRIENDED)
+ if (op != GD_OP_SYNC_VOLUME &&
+ peerinfo->state.state != GD_FRIEND_STATE_BEFRIENDED)
continue;
list_add_tail (&peerinfo->op_peers_list, xact_peers);
npeers++;
@@ -767,12 +769,14 @@ gd_commit_op_phase (struct list_head *peers, glusterd_op_t op, dict_t *op_ctx,
hostname = "localhost";
goto commit_done;
}
- ret = glusterd_syncop_aggr_rsp_dict (op, op_ctx, rsp_dict);
- if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "%s",
- (*op_errstr)? *op_errstr: "Failed to aggregate response "
- "from node/brick");
- goto out;
+ if (op != GD_OP_SYNC_VOLUME) {
+ ret = glusterd_syncop_aggr_rsp_dict (op, op_ctx, rsp_dict);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "%s",
+ "Failed to aggregate response "
+ "from node/brick");
+ goto out;
+ }
}
dict_unref (rsp_dict);
rsp_dict = NULL;
@@ -893,9 +897,11 @@ gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict, char **op
goto out;
}
- ret = glusterd_syncop_aggr_rsp_dict (op, op_ctx, rsp_dict);
- if (ret)
- goto out;
+ if (op == GD_OP_HEAL_VOLUME) {
+ ret = glusterd_syncop_aggr_rsp_dict (op, op_ctx, rsp_dict);
+ if (ret)
+ goto out;
+ }
dict_unref (rsp_dict);
rsp_dict = NULL;
@@ -970,7 +976,7 @@ gd_sync_task_begin (dict_t *op_ctx, rpcsvc_request_t * req)
* the 'cluster' lock*/
glusterd_op_set_op (op);
INIT_LIST_HEAD (&conf->xaction_peers);
- npeers = gd_build_peers_list (&conf->peers, &conf->xaction_peers);
+ npeers = gd_build_peers_list (&conf->peers, &conf->xaction_peers, op);
ret = gd_lock_op_phase (&conf->xaction_peers, op, op_ctx, &op_errstr, npeers);
if (ret)