From owner-svn-src-projects@freebsd.org Fri Jul 20 12:38:08 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBCEE1044361 for ; Fri, 20 Jul 2018 12:38:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 646C67AF80; Fri, 20 Jul 2018 12:38:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 419A1103AE; Fri, 20 Jul 2018 12:38:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6KCc8OJ045855; Fri, 20 Jul 2018 12:38:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6KCc8Pl045854; Fri, 20 Jul 2018 12:38:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807201238.w6KCc8Pl045854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 Jul 2018 12:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r336544 - projects/pnfs-planb-server/sys/fs/nfs X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/pnfs-planb-server/sys/fs/nfs X-SVN-Commit-Revision: 336544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2018 12:38:09 -0000 Author: rmacklem Date: Fri Jul 20 12:38:07 2018 New Revision: 336544 URL: https://svnweb.freebsd.org/changeset/base/336544 Log: Update the comments and add a sysctl to set the retry limit for connections from clients to DSs. This is for the client side pNFS and head/current will be getting this commit soon. Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs_commonkrpc.c Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfs/nfs_commonkrpc.c Fri Jul 20 12:32:17 2018 (r336543) +++ projects/pnfs-planb-server/sys/fs/nfs/nfs_commonkrpc.c Fri Jul 20 12:38:07 2018 (r336544) @@ -106,6 +106,7 @@ static int nfs_bufpackets = 4; static int nfs_reconnects; static int nfs3_jukebox_delay = 10; static int nfs_skip_wcc_data_onerr = 1; +static int nfs_dsretries = 2; SYSCTL_DECL(_vfs_nfs); @@ -117,6 +118,8 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTL "Number of seconds to delay a retry after receiving EJUKEBOX"); SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, "Disable weak cache consistency checking when server returns an error"); +SYSCTL_INT(_vfs_nfs, OID_AUTO, dsretries, CTLFLAG_RW, &nfs_dsretries, 0, + "Number of retries for a DS RPC before failure"); static void nfs_down(struct nfsmount *, struct thread *, const char *, int, int); @@ -303,14 +306,20 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq if (cred != NULL) { if (NFSHASSOFT(nmp)) { /* - * This should be a DS mount. If the - * timeout is set to 1/4th of the lease - * duration, the DS should be disabled - * at approximately 1/2 lease duration, - * due to a retry count of 2. - * This will hopefully cause the client - * to continue without the disabled - * DS in less than the lease duration. + * This should be a DS mount. + * Use CLSET_TIMEOUT to set the timeout + * for connections to DSs instead of + * specifying a timeout on each RPC. + * This is done so that SO_SNDTIMEO + * is set on the TCP socket as well + * as specifying a time limit when + * waiting for an RPC reply. Useful + * if the send queue for the TCP + * connection has become constipated, + * due to a failed DS. + * The choice of lease_duration / 4 is + * fairly arbitrary, but seems to work + * ok, with a lower bound of 10sec. */ timo.tv_sec = nfsrv_lease / 4; if (timo.tv_sec < 10) @@ -346,6 +355,10 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq * not maintain open/lock state and is the * only case where using a "soft" mount is * recommended for NFSv4. + * For mounts from the MDS to DS, this is done + * via mount options, but that is not the case + * here. The retry limit here can be adjusted + * via the sysctl vfs.nfs.dsretries. * See the comment above w.r.t. timeout. */ timo.tv_sec = nfsrv_lease / 4; @@ -353,7 +366,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq timo.tv_sec = 10; timo.tv_usec = 0; CLNT_CONTROL(client, CLSET_TIMEOUT, &timo); - retries = 2; + retries = nfs_dsretries; } } } else {