Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp862422pxu; Thu, 3 Dec 2020 14:46:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmhitJzgiyXG9ncHNGolJeFCNVXlqMgr5ivEal1PXdy6bkh7epDpnB4WnC5PxaFhhICj6h X-Received: by 2002:a50:af65:: with SMTP id g92mr4927770edd.273.1607035589484; Thu, 03 Dec 2020 14:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607035589; cv=none; d=google.com; s=arc-20160816; b=gTPjlCovNnUrIYjunTLCvaQpYOP9Q9UKG+hTj6PK9DDY+6CM0yrnOoRk6B3UTFTtzF L+qYFAzKTACrZgRpkjIo0C8zQ5AtqgY6spIn3Ad83n4nF6AWWao2Nd6HKN4AHZ68TOzB OvLP4z/RF7ftJIFTwrB3flAcNYJ5ZWc/C9rhBAtkr4eg5crjaLnxMg78MfTGIUQBt0Ws TNIiIKW44V/EHw1c6yseuCuivikiXEpSZIbt7r2sSJhIspoVaal4Vn2zhPURbI5n/udh 9FlxiqCdLLbxjYxpsj0j2W2tqB2hgaB0fDI/reDB3KWsJfEE2+CA6WUvU+NHw7QS8edl Px+A== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-filter; bh=ZdwUje1Pnx0Qt5VKBj9InKFhCEDJN154ucTg6t+uKCs=; b=Hbg0ysKAxXd9uruS9sD2yB3Xihysm+gho5RMQPp4iMuvrejCIkgk1M4HeWr181cYdS QQCVbzkdDNBVuVungch0aPR63VbAyF9QigGTpoAsvTlaGN0AgXPF3+M3B4giD1Ji9EbB pL1BDOL4ZiCkvRpvy6HuJoKG7rKrOG5K3e1Wyh7T7/AxJ+16vK8ZZVorCWTsfV06+BzC V0rIy7Tbdt1FIyvijX+TLMKH9fdl034b8xJsFXUQYTnSDp2/O1PAxIH2gf4eO8NjlcQG D4IuTSr1Xu808ZJ3xdHCQM+kTa1UJX+orYvxubecXkHpKUcEFHYHVP626/zEYeuNfgxz fQbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=zfVLF3lS; 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 a16si210989ejd.678.2020.12.03.14.46.06; Thu, 03 Dec 2020 14:46:29 -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=zfVLF3lS; 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 S1727748AbgLCWpf (ORCPT + 99 others); Thu, 3 Dec 2020 17:45:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727664AbgLCWpf (ORCPT ); Thu, 3 Dec 2020 17:45:35 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CFC7C061A4F for ; Thu, 3 Dec 2020 14:44:55 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id 9AF3E6F5E; Thu, 3 Dec 2020 17:44:54 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 9AF3E6F5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1607035494; bh=ZdwUje1Pnx0Qt5VKBj9InKFhCEDJN154ucTg6t+uKCs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zfVLF3lS2u+KBHJr8LZrHf3KCHiJER3DPJpBMf1rnQoKZwVa66KPB8DHRhMsZxP9T r8MeOry58Vjiuayp5DoyE65QdXwS6bkCogRZdhG9oJh87Q/sXQ1vq1AjeZspPjwkYi vlXwb12Rc0/JOQH8wRKqPwW4Ugf/r6FA7gw3hdO0= Date: Thu, 3 Dec 2020 17:44:54 -0500 From: "bfields@fieldses.org" To: Trond Myklebust Cc: "linux-cachefs@redhat.com" , "ffilzlnx@mindspring.com" , "linux-nfs@vger.kernel.org" , "daire@dneg.com" Subject: Re: Adventures in NFS re-exporting Message-ID: <20201203224454.GF27931@fieldses.org> References: <932244432.93596532.1606324491501.JavaMail.zimbra@dneg.com> <1403656117.98163597.1606998035261.JavaMail.zimbra@dneg.com> <20201203185109.GB27931@fieldses.org> <4903965f2beb742e0eca089b5db8aa3a4cabb7f0.camel@hammerspace.com> <20201203211328.GC27931@fieldses.org> <9df8556bf825bd0d565f057b115e35c1b507cf46.camel@hammerspace.com> <019001d6c9bd$acbeb6b0$063c2410$@mindspring.com> <20201203220421.GE27931@fieldses.org> <0452916df308e9419f472b0d5ffb41815014dce4.camel@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0452916df308e9419f472b0d5ffb41815014dce4.camel@hammerspace.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Dec 03, 2020 at 10:14:25PM +0000, Trond Myklebust wrote: > On Thu, 2020-12-03 at 17:04 -0500, bfields@fieldses.org wrote: > > On Thu, Dec 03, 2020 at 09:57:41PM +0000, Trond Myklebust wrote: > > > On Thu, 2020-12-03 at 13:45 -0800, Frank Filz wrote: > > > > > On Thu, 2020-12-03 at 16:13 -0500, bfields@fieldses.org wrote: > > > > > > On Thu, Dec 03, 2020 at 08:27:39PM +0000, Trond Myklebust > > > > > > wrote: > > > > > > > On Thu, 2020-12-03 at 13:51 -0500, bfields wrote: > > > > > > > > I've been scratching my head over how to handle reboot of > > > > > > > > a > > > > > > > > re- > > > > > > > > exporting server.  I think one way to fix it might be > > > > > > > > just to > > > > > > > > allow the re- export server to pass along reclaims to the > > > > > > > > original > > > > > > > > server as it receives them from its own clients.  It > > > > > > > > might > > > > > > > > require > > > > > > > > some protocol tweaks, I'm not sure.  I'll try to get my > > > > > > > > thoughts > > > > > > > > in order and propose something. > > > > > > > > > > > > > > > > > > > > > > It's more complicated than that. If the re-exporting server > > > > > > > reboots, > > > > > > > but the original server does not, then unless that re- > > > > > > > exporting > > > > > > > server persisted its lease and a full set of stateids > > > > > > > somewhere, it > > > > > > > will not be able to atomically reclaim delegation and lock > > > > > > > state on > > > > > > > the server on behalf of its clients. > > > > > > > > > > > > By sending reclaims to the original server, I mean literally > > > > > > sending > > > > > > new open and lock requests with the RECLAIM bit set, which > > > > > > would > > > > > > get > > > > > > brand new stateids. > > > > > > > > > > > > So, the original server would invalidate the existing > > > > > > client's > > > > > > previous clientid and stateids--just as it normally would on > > > > > > reboot--but it would optionally remember the underlying locks > > > > > > held by > > > > > > the client and allow compatible lock reclaims. > > > > > > > > > > > > Rough attempt: > > > > > > > > > > > > > > > > > > https://wiki.linux-nfs.org/wiki/index.php/Reboot_recovery_for_re-expor > > > > > > t_servers > > > > > > > > > > > > Think it would fly? > > > > > > > > > > So this would be a variant of courtesy locks that can be > > > > > reclaimed > > > > > by the client > > > > > using the reboot reclaim variant of OPEN/LOCK outside the grace > > > > > period? The > > > > > purpose being to allow reclaim without forcing the client to > > > > > persist the original > > > > > stateid? > > > > > > > > > > Hmm... That's doable, but how about the following alternative: > > > > > Add > > > > > a function > > > > > that allows the client to request the full list of stateids > > > > > that > > > > > the server holds on > > > > > its behalf? > > > > > > > > > > I've been wanting such a function for quite a while anyway in > > > > > order > > > > > to allow the > > > > > client to detect state leaks (either due to soft timeouts, or > > > > > due > > > > > to reordered > > > > > close/open operations). > > > > > > > > Oh, that sounds interesting. So basically the re-export server > > > > would > > > > re-populate it's state from the original server rather than > > > > relying > > > > on it's clients doing reclaims? Hmm, but how does the re-export > > > > server rebuild its stateids? I guess it could make the clients > > > > repopulate them with the same "give me a dump of all my state", > > > > using > > > > the state details to match up with the old state and replacing > > > > stateids. Or did you have something different in mind? > > > > > > > > > > I was thinking that the re-export server could just use that list > > > of > > > stateids to figure out which locks can be reclaimed atomically, and > > > which ones have been irredeemably lost. The assumption is that if > > > you > > > have a lock stateid or a delegation, then that means the clients > > > can > > > reclaim all the locks that were represented by that stateid. > > > > I'm confused about how the re-export server uses that list.  Are you > > assuming it persisted its own list across its own crash/reboot?  I > > guess > > that's what I was trying to avoid having to do. > > > No. The server just uses the stateids as part of a check for 'do I hold > state for this file on this server?'. If the answer is 'yes' and the > lock owners are sane, then we should be able to assume the full set of > locks that lock owner held on that file are still valid. > > BTW: if the lock owner is also returned by the server, then since the > lock owner is an opaque value, it could, for instance, be used by the > client to cache info on the server about which uid/gid owns these > locks. OK, so the list of stateids returned by the server has entries that look like (type, filehandle, owner, stateid) (where type=open or lock?). I guess I'd need to see this in more detail. --b.