|
|
cb8e9e |
From 6333e300cba4a2611815dd6fd53e0e246c2b0167 Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Atin Mukherjee <amukherj@redhat.com>
|
|
|
cb8e9e |
Date: Thu, 9 Jul 2015 12:17:59 +0530
|
|
|
cb8e9e |
Subject: [PATCH 216/234] glusterd: correct replace-brick flow
|
|
|
cb8e9e |
|
|
|
cb8e9e |
commit 9d2971 assumed that replace-brick is a op-sm transaction. This patch
|
|
|
cb8e9e |
fixes the replace brick flow as its a syncop transaction now.
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: I4c18a9c8db6173632b6d94d8609a7af3b912ae48
|
|
|
cb8e9e |
BUG: 1230525
|
|
|
cb8e9e |
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/52639
|
|
|
cb8e9e |
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
|
|
|
cb8e9e |
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
|
|
|
cb8e9e |
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 14 --------------
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 21 ---------------------
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-syncop.c | 5 +++++
|
|
|
cb8e9e |
3 files changed, 5 insertions(+), 35 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
cb8e9e |
index b1ee5e3..dbdaec0 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
cb8e9e |
@@ -3996,7 +3996,6 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx)
|
|
|
cb8e9e |
char *op_errstr = NULL;
|
|
|
cb8e9e |
glusterd_op_t op = GD_OP_NONE;
|
|
|
cb8e9e |
uint32_t pending_count = 0;
|
|
|
cb8e9e |
- glusterd_op_info_t txn_op_info = {{0},};
|
|
|
cb8e9e |
|
|
|
cb8e9e |
this = THIS;
|
|
|
cb8e9e |
GF_ASSERT (this);
|
|
|
cb8e9e |
@@ -4048,19 +4047,6 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx)
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- if (op == GD_OP_REPLACE_BRICK) {
|
|
|
cb8e9e |
- ret = glusterd_get_txn_opinfo (&event->txn_id, &txn_op_info);
|
|
|
cb8e9e |
- if (ret) {
|
|
|
cb8e9e |
- gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
- GD_MSG_TRANS_OPINFO_GET_FAIL,
|
|
|
cb8e9e |
- "Failed to get txn_op_info "
|
|
|
cb8e9e |
- "for txn_id = %s", uuid_utoa (event->txn_id));
|
|
|
cb8e9e |
- goto out;
|
|
|
cb8e9e |
- }
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
- glusterd_rb_use_rsp_dict (txn_op_info.op_ctx, rsp_dict);
|
|
|
cb8e9e |
- }
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
rcu_read_lock ();
|
|
|
cb8e9e |
cds_list_for_each_entry_rcu (peerinfo, &priv->peers, uuid_list) {
|
|
|
cb8e9e |
/* Only send requests to peers who were available before the
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
|
|
|
cb8e9e |
index 50820d7..0890b02 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
|
|
|
cb8e9e |
@@ -1131,7 +1131,6 @@ __glusterd_stage_op_cbk (struct rpc_req *req, struct iovec *iov,
|
|
|
cb8e9e |
xlator_t *this = NULL;
|
|
|
cb8e9e |
glusterd_conf_t *priv = NULL;
|
|
|
cb8e9e |
uuid_t *txn_id = NULL;
|
|
|
cb8e9e |
- glusterd_op_info_t txn_op_info = {{0},};
|
|
|
cb8e9e |
|
|
|
cb8e9e |
this = THIS;
|
|
|
cb8e9e |
GF_ASSERT (this);
|
|
|
cb8e9e |
@@ -1201,14 +1200,6 @@ out:
|
|
|
cb8e9e |
gf_msg_debug (this->name, 0, "transaction ID = %s",
|
|
|
cb8e9e |
uuid_utoa (*txn_id));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- ret = glusterd_get_txn_opinfo (txn_id, &txn_op_info);
|
|
|
cb8e9e |
- if (ret) {
|
|
|
cb8e9e |
- gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
- GD_MSG_TRANS_OPINFO_GET_FAIL,
|
|
|
cb8e9e |
- "Failed to get txn_op_info "
|
|
|
cb8e9e |
- "for txn_id = %s", uuid_utoa (*txn_id));
|
|
|
cb8e9e |
- }
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
rcu_read_lock ();
|
|
|
cb8e9e |
peerinfo = glusterd_peerinfo_find (rsp.uuid, NULL);
|
|
|
cb8e9e |
if (peerinfo == NULL) {
|
|
|
cb8e9e |
@@ -1240,12 +1231,6 @@ out:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
rcu_read_unlock ();
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- switch (rsp.op) {
|
|
|
cb8e9e |
- case GD_OP_REPLACE_BRICK:
|
|
|
cb8e9e |
- glusterd_rb_use_rsp_dict (txn_op_info.op_ctx, dict);
|
|
|
cb8e9e |
- break;
|
|
|
cb8e9e |
- }
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
ret = glusterd_op_sm_inject_event (event_type, txn_id, NULL);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!ret) {
|
|
|
cb8e9e |
@@ -1398,12 +1383,6 @@ __glusterd_commit_op_cbk (struct rpc_req *req, struct iovec *iov,
|
|
|
cb8e9e |
GF_ASSERT (rsp.op == txn_op_info.op);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
switch (rsp.op) {
|
|
|
cb8e9e |
- case GD_OP_REPLACE_BRICK:
|
|
|
cb8e9e |
- ret = glusterd_rb_use_rsp_dict (txn_op_info.op_ctx, dict);
|
|
|
cb8e9e |
- if (ret)
|
|
|
cb8e9e |
- goto unlock;
|
|
|
cb8e9e |
- break;
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
case GD_OP_PROFILE_VOLUME:
|
|
|
cb8e9e |
ret = glusterd_profile_volume_use_rsp_dict (txn_op_info.op_ctx, dict);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
|
|
|
cb8e9e |
index 1d5deb8..5a1ffb4 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
|
|
|
cb8e9e |
@@ -245,6 +245,11 @@ glusterd_syncop_aggr_rsp_dict (glusterd_op_t op, dict_t *aggr, dict_t *rsp)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+ case GD_OP_REPLACE_BRICK:
|
|
|
cb8e9e |
+ ret = glusterd_rb_use_rsp_dict (aggr, rsp);
|
|
|
cb8e9e |
+ if (ret)
|
|
|
cb8e9e |
+ goto out;
|
|
|
cb8e9e |
+ break;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
case GD_OP_SYNC_VOLUME:
|
|
|
cb8e9e |
ret = glusterd_sync_use_rsp_dict (aggr, rsp);
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|