From fc39ee2ea3a22704ebacd0607cf6fd4eae9ec66a Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 2 May 2013 09:11:58 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/4922 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- rpc/rpc-lib/src/rpc-clnt.c | 36 +++++++----------------------------- rpc/rpc-lib/src/rpc-clnt.h | 9 --------- 2 files changed, 7 insertions(+), 38 deletions(-) (limited to 'rpc/rpc-lib') diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index a27d04791..e6c681df8 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1384,14 +1384,13 @@ out: int -rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, - int procnum, fop_cbk_fn_t cbkfn, - struct iovec *proghdr, int proghdrcount, - struct iovec *progpayload, int progpayloadcount, - struct iobref *iobref, void *frame, struct iovec *rsphdr, - int rsphdr_count, struct iovec *rsp_payload, - int rsp_payload_count, struct iobref *rsp_iobref, - gf_boolean_t *lost) +rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, + int procnum, fop_cbk_fn_t cbkfn, + struct iovec *proghdr, int proghdrcount, + struct iovec *progpayload, int progpayloadcount, + struct iobref *iobref, void *frame, struct iovec *rsphdr, + int rsphdr_count, struct iovec *rsp_payload, + int rsp_payload_count, struct iobref *rsp_iobref) { rpc_clnt_connection_t *conn = NULL; struct iobuf *request_iob = NULL; @@ -1402,7 +1401,6 @@ rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int proglen = 0; char new_iobref = 0; uint64_t callid = 0; - gf_boolean_t cbk_lost = _gf_true; if (!rpc || !prog || !frame) { goto out; @@ -1491,7 +1489,6 @@ rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, if ((ret >= 0) && frame) { /* Save the frame in queue */ - cbk_lost = _gf_false; __save_frame (rpc, frame, rpcreq); gf_log ("rpc-clnt", GF_LOG_TRACE, "submitted request " @@ -1522,31 +1519,12 @@ out: if (rpcreq) { rpcreq->rpc_status = -1; cbkfn (rpcreq, NULL, 0, frame); - cbk_lost = _gf_false; mem_put (rpcreq); } } - if (lost) - *lost = cbk_lost; return ret; } -int -rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, - int procnum, fop_cbk_fn_t cbkfn, - struct iovec *proghdr, int proghdrcount, - struct iovec *progpayload, int progpayloadcount, - struct iobref *iobref, void *frame, struct iovec *rsphdr, - int rsphdr_count, struct iovec *rsp_payload, - int rsp_payload_count, struct iobref *rsp_iobref) -{ - return rpc_clnt_submit2 (rpc, prog, procnum, cbkfn, proghdr, - proghdrcount, progpayload, progpayloadcount, - iobref, frame, rsphdr, rsphdr_count, - rsp_payload, rsp_payload_count, rsp_iobref, - NULL); -} - struct rpc_clnt * rpc_clnt_ref (struct rpc_clnt *rpc) diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h index 34612fcc4..0da165559 100644 --- a/rpc/rpc-lib/src/rpc-clnt.h +++ b/rpc/rpc-lib/src/rpc-clnt.h @@ -216,15 +216,6 @@ int rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int rsphdr_count, struct iovec *rsp_payload, int rsp_payload_count, struct iobref *rsp_iobref); -int rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, - int procnum, fop_cbk_fn_t cbkfn, - struct iovec *proghdr, int proghdrcount, - struct iovec *progpayload, int progpayloadcount, - struct iobref *iobref, void *frame, struct iovec *rsphdr, - int rsphdr_count, struct iovec *rsp_payload, - int rsp_payload_count, struct iobref *rsp_iobref, - gf_boolean_t *cbk_lost); - struct rpc_clnt * rpc_clnt_ref (struct rpc_clnt *rpc); -- cgit