Re: [nfsv4] RFC: Is Open/Claim_Delegate_Prev done before/after Reclaim_complete?

Rick Macklem <rick.macklem@gmail.com> Fri, 05 April 2024 23:13 UTC

Return-Path: <rick.macklem@gmail.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9B796C180B4D for <nfsv4@ietfa.amsl.com>; Fri, 5 Apr 2024 16:13:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.098
X-Spam-Level:
X-Spam-Status: No, score=-7.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FZTDNIcmY7is for <nfsv4@ietfa.amsl.com>; Fri, 5 Apr 2024 16:13:11 -0700 (PDT)
Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 25033C15199C for <nfsv4@ietf.org>; Fri, 5 Apr 2024 16:13:11 -0700 (PDT)
Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-29ddfada0d0so1946281a91.3 for <nfsv4@ietf.org>; Fri, 05 Apr 2024 16:13:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712358790; x=1712963590; darn=ietf.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eiH95dLVfBgo3KxazXfiwn3SB9NJjXYlA8lyxo9PHRs=; b=PYvbpa/29Znu4fBFkOmYUFdnjrF1reqPBwxNAsWWY3EExxcFCxdn1Lnfhj/8sKBiIh 3sil83phdLHH9xcOe0TvPE0pQPlSrPEhQUpXaOG+wiLq3HWC5MCF/2JXR4Qi1o9Pgbff QOYlN1Q1ZRlN7vQ8XqGnOUtPWeKdA3TZPV0HXFs6+zBkyNxkBiN3rA3cKT3an+QDbbsx 7jVEv98iHK/jEZmyEM6biVTJMOlyndyQKAWPsLLuWclcsJYr8kZ3oQPWu2GaxRupuedA KG8bahHD+aD0CjP7zTCJ063fuTov1CWp2n4QiVdA+kGl28Resdn02h8nafW1pVmNWlqE XmXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712358790; x=1712963590; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eiH95dLVfBgo3KxazXfiwn3SB9NJjXYlA8lyxo9PHRs=; b=Op62k7pOI5OMR7H7ekBcw73HHemJ1S8eolOsqMsT1A2De58Bi3MTgytw8TLvgNkzic nyqIaoeQSdaljGn/PS2y8kvaWB+giq2E1D31GLnMg9+4qs3mCX2QwlBT89MEJ01NDLnn oYpRTN1QL85wUiScAdums49OqOqq1kXHedc9FpbGAyQxJTOLo3Wsbqy3MU6Flb81jtgM 9brMHQuXcwtdKvSkGtjv0jj7XssetlEY47V0n/B+w1FCv4bFBU3gM7j9O0EbZ6U+2ax5 IarhoeweugV4VwePIDTy50jqc+fQnz23cF4J3hgNFDgJvQaZJwoHyojNejjFaZmWoOxj 9EYQ==
X-Gm-Message-State: AOJu0Yz13nILUOB1FrGTGyzZE+whGVHge7YqmDsETHHUiVOK6bzC5C4x Pw0YdsDe7nJLgxt9SDz+MM40bG6iGhKtkxaomgms406+rdAhwKFUpZ2q8uu40osjuHWn0FkJUnn 9XQkKi7XIC828TOZLJczbFJtzPYmTa1Q=
X-Google-Smtp-Source: AGHT+IEMt5WNXaK2XRUlyxahXgeH9uvw6dR4Jy2MSp4ydFKUTMmKQaeIfZyrja532eNEibrMW01Y4R7bnxjvBEpXQeA=
X-Received: by 2002:a17:90b:503:b0:29b:961a:29c3 with SMTP id r3-20020a17090b050300b0029b961a29c3mr2332121pjz.49.1712358790114; Fri, 05 Apr 2024 16:13:10 -0700 (PDT)
MIME-Version: 1.0
References: <CAM5tNy4y36AEyD5SeOZ2F1t8AYhu8-ZKPyNvCd-dmydFg1kJtA@mail.gmail.com> <19e3502ca1859608975bd17dc18e6774bf0bfab3.camel@hammerspace.com>
In-Reply-To: <19e3502ca1859608975bd17dc18e6774bf0bfab3.camel@hammerspace.com>
From: Rick Macklem <rick.macklem@gmail.com>
Date: Fri, 05 Apr 2024 16:13:00 -0700
Message-ID: <CAM5tNy41j0BLi0ixu=VA_rT14GxL7ZKKwbSyb1UAgf-xAE8m+g@mail.gmail.com>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: "nfsv4@ietf.org" <nfsv4@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/lOE7Ql1E6ej17Bfr4rxVVzTkyAE>
Subject: Re: [nfsv4] RFC: Is Open/Claim_Delegate_Prev done before/after Reclaim_complete?
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 05 Apr 2024 23:13:11 -0000

On Thu, Apr 4, 2024 at 9:18 PM Trond Myklebust <trondmy@hammerspace.com> wrote:
>
> On Thu, 2024-04-04 at 16:23 -0700, Rick Macklem wrote:
> > Hi,
> >
> > I am in the process of implementing Open/Claim_Delegate_Prev and have
> > run
> > into a question I cannot seem to answer from reading RFC8881.
> >
> > There is this snippet:
> >    enum open_claim_type4 {
> >            /*
> >             * Not a reclaim.
> >             */
> >            CLAIM_NULL              = 0,
> >
> >            CLAIM_PREVIOUS          = 1,
> >            CLAIM_DELEGATE_CUR      = 2,
> >            CLAIM_DELEGATE_PREV     = 3,
> >
> >            /*
> >             * Not a reclaim.
> >             *
> >             * Like CLAIM_NULL, but object identified
> >             * by the current filehandle.
> >             */
> >            CLAIM_FH                = 4, /* new to v4.1 */
> > The comments in the above seem to "hint" that CLAIM_DELEGATE_PREV is
> > a
> > reclaim type operation.
> > If that is the case, I'd assume it/should be performed by the client
> > before it does a
> > Reclaim_Complete?
> >
> > Then there is this snippet:
> >    For OPEN requests that reach the server during the grace period,
> > the
> >    server returns an error of NFS4ERR_GRACE.  The following claim
> > types
> >    are exceptions:
> >
> >    *  OPEN requests specifying the claim type CLAIM_PREVIOUS are
> > devoted
> >       to reclaiming opens after a server restart and are typically
> > only
> >       valid during the grace period.
> >
> >    *  OPEN requests specifying the claim types CLAIM_DELEGATE_CUR and
> >       CLAIM_DELEG_CUR_FH are valid both during and after the grace
> >       period.  Since the granting of the delegation that they are
> >       subordinate to assures that there is no conflict with locks to
> > be
> >       reclaimed by other clients, the server need not return
> >       NFS4ERR_GRACE when these are received during the grace period.
> > This clearly states that CLAIM_DELEGATE_PREV cannot be performed
> > during the server's grace period.
> >
> > The above two statements are not necessarily contradictory but it
> > does seem
> > that, if the server is in its grace period, the Reclaim_Complete
> > needs to be
> > done before any Open/Claim_Delegate_Prev, since Reclaim_Complete
> > tells
> > the server when to end its grace period.
> > Note that, usually, a client would not be rebooting when a server is
> > in its
> > grace period, but that could happen.
> >
> > Bottom line...
> > Should a client perform Open/Claim_Delegate_Prev before or after
> > Reclaim_Complete?
> > And, if the answer is "after", how does the server know when a client
> > is done recovering opens/delegations via Open/Claim_Delegate_Prev?
> >
> > Thanks for any help with this, rick
>
> CLAIM_DELEGATE_PREV has now survived at least 24 years as part of a
> "standard" and has yet to be properly described. I can find references
> to it in RFC3010 and all NFSv4 descriptions since then, but I have yet
> to meet anybody who can claim to have implemented it in a product.
>
> IMO, it is time to drop it, and start afresh with something that has
> actually been road tested before someone started putting pen to paper.
Well, I am going to respond to David's post in some more detail, but I will
note here that, with the exception of whether to do it before or after
Reclaim_complete,
I have not found serious issues with it. (Btw, the FreeBSD server has
had a "dormant"
implementation for about 20years, although I am just now trying to use it by the
FreeBSD client. I was wondering if I would find any other server
implementation at
the Bakeathon in a couple of weeks.)

The one other thing I have found "inconvenient" about it is similar to
what Tom is
trying to address with one of his drafts. That is that the client use
I have for it has
no use for an Open and simply closes it as soon as received. (It may be possible
to use Tom's proposed extension to Open to tell the server "I only want the
delegation and no open". (This is, as I note, only an inconvenience and slight
inefficiency, since closing the received open works.)

rick

>
> In other words, let's figure out what we want from this feature, and
> actually attempt to implement it before we start arguing about how to
> interpret an uninteresting 24 year old "spec".
>
> --
> Trond Myklebust
> Linux NFS client maintainer, Hammerspace
> trond.myklebust@hammerspace.com
>
>