From c61bc1f9e5874cb8380ec6398680fc71aea233b4 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Mon, 7 Apr 2014 10:57:45 +0530 Subject: glusterd: Ping timer implmentation This patch refactors the existing client ping timer implementation, and makes use of the common code for implementing both client ping timer and the glusterd ping timer. A new gluster rpc program for ping is introduced. The ping timer is only started for peers that have this new program. The deafult glusterd ping timeout is 30 seconds. It is configurable by setting the option 'ping-timeout' in glusterd.vol . Also, this patch introduces changes in the glusterd-handshake path. The client programs for a peer are now set in the callback of dump_versions, for both the older handshake and the newer op-version handshake. This is the only place in the handshake process where we know what programs a peer supports. Change-Id: I035815ac13449ca47080ecc3253c0a9afbe9016a BUG: 1038261 Signed-off-by: Vijaikumar M Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/5202 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/protocol/client/src/client-rpc-fops.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'xlators/protocol/client/src/client-rpc-fops.c') diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index 99a6f6d7492..e77da7a27d6 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -14,12 +14,12 @@ #endif #include "client.h" +#include "rpc-common-xdr.h" #include "glusterfs3-xdr.h" #include "glusterfs3.h" #include "compat-errno.h" int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data); -void client_start_ping (void *data); rpc_clnt_prog_t clnt3_3_fop_prog; @@ -35,13 +35,10 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame, struct iovec iov = {0, }; struct iobuf *iobuf = NULL; int count = 0; - int start_ping = 0; struct iobref *new_iobref = NULL; ssize_t xdr_size = 0; struct rpc_req rpcreq = {0, }; - start_ping = 0; - conf = this->private; if (req && xdrproc) { @@ -95,19 +92,6 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame, gf_log (this->name, GF_LOG_DEBUG, "rpc_clnt_submit failed"); } - if (ret == 0) { - pthread_mutex_lock (&conf->rpc->conn.lock); - { - if (!conf->rpc->conn.ping_started) { - start_ping = 1; - } - } - pthread_mutex_unlock (&conf->rpc->conn.lock); - } - - if (start_ping) - client_start_ping ((void *) this); - if (new_iobref) iobref_unref (new_iobref); -- cgit