summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-syncop.h
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2013-05-02 09:11:58 +0530
committerAnand Avati <avati@redhat.com>2013-05-04 21:35:52 -0700
commitfc39ee2ea3a22704ebacd0607cf6fd4eae9ec66a (patch)
treec1c73563970ca2983168e8f1d09bfca484504eeb /xlators/mgmt/glusterd/src/glusterd-syncop.h
parent83cedcd9be2676e63b1be72ecaf3316a781773cb (diff)
Revert "glusterd: Fix spurious wakeups in glusterd syncops"
This reverts commit efa154bb0a4cac34d5a9610ec25d38eebe495f22. -- Following is Avati's analysis (edited) from gerrit -- The claim of the patch (being reverted) is that it in some cases cbkfn is missed. This is wrong analysis. cbk_fn is _always_ called. The patch treats ret > 0 as a "missed cbk". ret > 0 only means socket submission was not complete, and is queued to submit asynchronously when POLLOUT is raised. This is sufficient to guarantee that cbkfn is going to be called (either the socket errors or submission succeeds and reply eventually arrives). This commit also removes spurious barrier_wake(s). call backs are guaranteed to be called even if the transport is disconnected. This means, a 'wake' would be called if rpc_clnt_submit is called. Also, we count both successful and failed operations in a particular batch of operations for the synctask_barrier_wait. So, calling synctask_barrier_wake on failure of rpc_clnt_submit (say, due to network failure) would result in a spurious wake. Change-Id: I7d508c2a54b74a65b82f097742206bc777afc53a BUG: 948686 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/4922 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h
index 3e3980c442f..9318862e508 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.h
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h
@@ -19,7 +19,7 @@
int ret = 0; \
struct synctask *task = NULL; \
glusterd_conf_t *conf= THIS->private; \
- gf_boolean_t cbk_lost = _gf_true; \
+ \
task = synctask_get (); \
stb->task = task; \
\
@@ -28,9 +28,8 @@
synclock_unlock (&conf->big_lock); \
ret = gd_syncop_submit_request (rpc, req, stb, \
prog, procnum, cbk, \
- (xdrproc_t)xdrproc, \
- &cbk_lost); \
- if (!cbk_lost) \
+ (xdrproc_t)xdrproc); \
+ if (!ret) \
synctask_yield (stb->task); \
synclock_lock (&conf->big_lock); \
} while (0)
@@ -39,7 +38,7 @@
int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req,
void *cookie, rpc_clnt_prog_t *prog,
int procnum, fop_cbk_fn_t cbkfn,
- xdrproc_t xdrproc, gf_boolean_t *cbk_lost);
+ xdrproc_t xdrproc);
int gd_syncop_mgmt_lock (struct rpc_clnt *rpc, struct syncargs *arg,