From 3b647e10124cfc22983b11bf9bfaa36289a2a42f Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Sun, 29 Mar 2015 19:59:19 +0530 Subject: glusterd: Use txn_opinfo instead of global op_info in glusterd_volume_heal_use_rsp_dict Due to http://review.gluster.org/#/c/9908/ global opinfo is no more a valid place holder for keeping transaction information for syncop task. glusterd_volume_heal_use_rsp_dict () was referring to global op_info due to which the function was always asserting on the op code. Change-Id: I1d416fe4edb40962fe7a0f6ecf541602debac56e BUG: 1206655 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/10034 Reviewed-by: Emmanuel Dreyfus Tested-by: Emmanuel Dreyfus Reviewed-by: Venky Shankar Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-utils.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index d9e22125a3a..243703786e9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -8302,20 +8302,35 @@ out: int glusterd_volume_heal_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict) { - int ret = 0; - dict_t *ctx_dict = NULL; - glusterd_op_t op = GD_OP_NONE; + int ret = 0; + dict_t *ctx_dict = NULL; + uuid_t *txn_id = NULL; + glusterd_op_info_t txn_op_info = {{0},}; + glusterd_op_t op = GD_OP_NONE; GF_ASSERT (rsp_dict); - op = glusterd_op_get_op (); + ret = dict_get_bin (aggr, "transaction_id", (void **)&txn_id); + if (ret) + goto out; + gf_log (THIS->name, GF_LOG_DEBUG, "transaction ID = %s", + uuid_utoa (*txn_id)); + + ret = glusterd_get_txn_opinfo (txn_id, &txn_op_info); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, "Failed to get txn_op_info " + "for txn_id = %s", uuid_utoa (*txn_id)); + goto out; + } + + op = txn_op_info.op; GF_ASSERT (GD_OP_HEAL_VOLUME == op); if (aggr) { ctx_dict = aggr; } else { - ctx_dict = glusterd_op_get_ctx (op); + ctx_dict = txn_op_info.op_ctx; } if (!ctx_dict) -- cgit