Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1470734pxb; Wed, 12 Jan 2022 15:52:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXqWD+jAlka2qiaIbTbCgbK0dzJmXcAIshZ7aJtRNl2s4/vs4LZABBi0IXF/Jph4CxkMCF X-Received: by 2002:a05:6a00:21c7:b0:4bc:1d4d:dfe with SMTP id t7-20020a056a0021c700b004bc1d4d0dfemr1660835pfj.15.1642031566826; Wed, 12 Jan 2022 15:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642031566; cv=none; d=google.com; s=arc-20160816; b=aj2baLx/apv4UOoucPCkojUX2bcIUm2PKaWeiN4NiAC9K0xZE+wGgjcVKUM/w2M3f2 kaIwqgr4GQQnZqiGmRya4I4Jn8gRfaJABpJqmatbjJtrNUgMoK6hDu2VvcOYf8NOF6jq Sh+h8+voVCa/A4U6M2/65/eoOa+4QPOvyWf3YpKxZj1/Cho6NJKC1vQOSFDN8FKIlZSd sByjzvK7fg1zunM/cQIMHwAva32gY/0YEGh2NsYuTtsLz+ujnCCzWG5dQN+QLHcidsd9 04FMHST+SW1egGWmvKRE6ZxZhxABOmpdUp6LwxtlcYZfuhfNswAaxkhkdb4bnyCE5qZF gfdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=S4P06q/HztrcXqQuR6afTAX+euXXAUsicN336T79Jf4=; b=LxH64YeezBPIwtjd0CRNkx1OAX2oB7Xa5QaL4DAIN0VL2sSK3d9Kw1KF0N/fByIGhv wyorGUd5vaq7llj9pDsw0nWXERqHTKxhvYF6bX9LLqRl/1UPzY1jMsWhXHbsoCsstpqo E00TR/uejtv/Os0GZIiKwYXybIyyBEHbFSAWFnr7ZJQLgMOc/p4h8kTjP7rX0GnOLU1U Y6utmIxDJ2WwwE89RDoxfzTWEUgQCtfQ8ECm9409RAfPbSNpiIv/zwbOGS7QouDJ0CNz K6tjWlcl3yYtJNm2SlldYoE4UUUgXpR4QGJ+SROIHsO8IRn1mH+mF9GLy6/9gwMXtHl4 QOVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=Utf0mgsp; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk13si1495312pjb.34.2022.01.12.15.52.34; Wed, 12 Jan 2022 15:52:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=Utf0mgsp; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343980AbiALSxb (ORCPT + 99 others); Wed, 12 Jan 2022 13:53:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241913AbiALSx2 (ORCPT ); Wed, 12 Jan 2022 13:53:28 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E62BC06173F; Wed, 12 Jan 2022 10:53:28 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id 905247306; Wed, 12 Jan 2022 13:53:27 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 905247306 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1642013607; bh=S4P06q/HztrcXqQuR6afTAX+euXXAUsicN336T79Jf4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Utf0mgspp8a7heEEYSXF/VRMDNC9XH7o277BkDi+ynWrGSunyv1FsATwxaEqB1sMq Z5xDIzYFLoq6IoPogIGiQ2iO31zZPdda8aP1gWVaxmXhKMFiq2Uq3/DZEFwhZyG81c woYtyE7h5Vg+Ytjt38NmSZuePyltwmhgqWvKZ0co= Date: Wed, 12 Jan 2022 13:53:27 -0500 From: Bruce Fields To: Chuck Lever III Cc: Dai Ngo , Jeff Layton , Al Viro , Linux NFS Mailing List , "linux-fsdevel@vger.kernel.org" Subject: Re: [PATCH RFC v9 2/2] nfsd: Initial implementation of NFSv4 Courteous Server Message-ID: <20220112185327.GA10518@fieldses.org> References: <1641840653-23059-1-git-send-email-dai.ngo@oracle.com> <1641840653-23059-3-git-send-email-dai.ngo@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Jan 11, 2022 at 03:49:19PM +0000, Chuck Lever III wrote: > > On Jan 10, 2022, at 8:03 PM, Dai Ngo wrote: > > I think this is something you and Bruce have been discussing > > on whether when we should remove and add the client record from > > the database when the client transits from active to COURTESY > > and vice versa. With this patch we now expire the courtesy clients > > asynchronously in the background so the overhead/delay from > > removing the record from the database does not have any impact > > on resolving conflicts. > > As I recall, our idea was to record the client as expired when > it transitions from active to COURTEOUS so that if the server > happens to reboot, it doesn't allow a courteous client to > reclaim locks the server may have already given to another > active client. > > So I think the server needs to do an nfsdtrack upcall when > transitioning from active -> COURTEOUS to prevent that edge > case. That would happen only in the laundromat, right? > > So when a COURTEOUS client comes back to the server, the server > will need to persistently record the transition from COURTEOUS > to active. Yep. The bad case would be: - client A is marked DESTROY_COURTESY, client B is given A's lock. - server goes down before laundromat thread removes the DESTROY_COURTESY client. - client A's network comes back up. - server comes back up and starts grace period. At this point, both A and B believe they have the lock. Also both still have nfsdcltrack records, so the server can't tell which is in the right. We can't start granting A's locks to B until we've recorded in stable storage that A has expired. What we'd like to do: - When a client transitions from active to courteous, it needs to do nfsdcltrack upcall to expire it. - We mark client as COURTESY only after that upcall has returned. - When the client comes back, we do an nfsdcltrack upcall to mark it as active again. We don't remove the COURTESY mark until that's returned. --b.