diff options
author | Pranith K <pranithk@gluster.com> | 2011-03-07 04:38:35 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-03-07 08:01:17 -0800 |
commit | f3dc620caaa7068ff12323a0001075140624733c (patch) | |
tree | c91e933546416a835b86afa086630896eb0d3f90 | |
parent | 108de35b1775db82cccaf0bd1b62ccacfb1c61e8 (diff) |
mgmt/glusterd: reset pending count before sending the op
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2493 ([glusterfs-3.1.3qa4]: glusterd not reaching default state on errors)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2493
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index c994db40c..2f6053ab8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -4595,6 +4595,7 @@ glusterd_op_ac_send_lock (glusterd_op_sm_event_t *event, void *ctx) glusterd_conf_t *priv = NULL; xlator_t *this = NULL; glusterd_peerinfo_t *peerinfo = NULL; + uint32_t pending_count = 0; this = THIS; priv = this->private; @@ -4614,10 +4615,11 @@ glusterd_op_ac_send_lock (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, peerinfo); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; if (!opinfo.pending_count) ret = glusterd_op_sm_inject_all_acc (); @@ -4634,6 +4636,7 @@ glusterd_op_ac_send_unlock (glusterd_op_sm_event_t *event, void *ctx) glusterd_conf_t *priv = NULL; xlator_t *this = NULL; glusterd_peerinfo_t *peerinfo = NULL; + uint32_t pending_count = 0; this = THIS; priv = this->private; @@ -4659,10 +4662,11 @@ glusterd_op_ac_send_unlock (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, peerinfo); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; if (!opinfo.pending_count) ret = glusterd_op_sm_inject_all_acc (); @@ -4826,6 +4830,7 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) dict_t *dict = NULL; char *op_errstr = NULL; int i = 0; + uint32_t pending_count = 0; this = THIS; GF_ASSERT (this); @@ -4880,10 +4885,11 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, dict); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; out: if (ret) { glusterd_op_sm_inject_event (GD_OP_EVENT_RCVD_RJT, NULL); @@ -4950,6 +4956,7 @@ glusterd_op_ac_send_commit_op (glusterd_op_sm_event_t *event, void *ctx) glusterd_peerinfo_t *peerinfo = NULL; char *op_errstr = NULL; int i = 0; + uint32_t pending_count = 0; this = THIS; GF_ASSERT (this); @@ -5000,10 +5007,11 @@ glusterd_op_ac_send_commit_op (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, dict); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; gf_log ("glusterd", GF_LOG_NORMAL, "Sent op req to %d peers", opinfo.pending_count); out: |