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

Rick Macklem <rick.macklem@gmail.com> Fri, 05 April 2024 23:57 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 2BCD8C16943A for <nfsv4@ietfa.amsl.com>; Fri, 5 Apr 2024 16:57:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.096
X-Spam-Level:
X-Spam-Status: No, score=-7.096 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, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=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 W2Gky-0e-VxC for <nfsv4@ietfa.amsl.com>; Fri, 5 Apr 2024 16:57:56 -0700 (PDT)
Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 648C8C169416 for <nfsv4@ietf.org>; Fri, 5 Apr 2024 16:57:56 -0700 (PDT)
Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e252f2bf23so24132135ad.2 for <nfsv4@ietf.org>; Fri, 05 Apr 2024 16:57:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712361475; x=1712966275; 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=4ZMYb+gAKYFddo2dKro73VBdx8sPeGCqgKWfYTQlwEs=; b=LGZhn1Ndvf+7R1qd1NYYVxHBu6kLJaJIt4fQOg2CbKUV5VsbzaH48pMU4Q3PRKZt52 iEYV7cLuWk+ClBFl1A2qfcPFCbdsnexMDxUEgPIeXRrWAoEZGQZvGMqJ1CFtvuVwS6j9 ekzBtAbDmCgwgRrNUfMNTvphCh1IwiB7R3JoFA0xVq87geKLcrdmwR+TrNr0m0bIZLpC mcKzZ//69Xfuup277xTi4A5U0HPs6y1mFn/LJqVpmFsDiFktStj96fs6LAB1OquPMmJv wH4pRaay87xMlon72xpoQMB9pKJC/tcp6BFPOpysCnzR6Z/Ui4O5aKrfGxZ0zvKPAksx u3wQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712361475; x=1712966275; 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=4ZMYb+gAKYFddo2dKro73VBdx8sPeGCqgKWfYTQlwEs=; b=A5ZhV1Hy6MdY6EGACV2C/R17wAAxc+WAVMtwCVxutmbUN6dATpAyYxAuQU/14mLMdL 4rpTz3qF94uZyTc7uDlydQ+2WcXScHuFxebF2hPm1yb7aZNvrrSD1UCyUpuZxrOHlEm/ pJiLtdFTZ7PP6upTK3wwFHFdtacF/oWhZ0OmhHfClHoqHoNok6rDuD4cBMemENJOVKIp ScxT79Ehk2Z7wVbd/AGUY8pz9dqfn06KBiTmaZ/a/hpDSmy/F81FsbCHRYVDkv9QW9II P1mFzsFBniiFd9ua34yyBfcDODWxM3O6T30uPCk4Tx5K9ZxKyK4HpsFYBP+THGL5z312 EBqg==
X-Gm-Message-State: AOJu0Yy4EBbWmM/y2XHscgBTgkYsQ0/ilrcWIJi6Ci0UtmFwXAfMP3Ui 0VjdSThY5J+CJJ7E4RzL0RoRY3dKJetth0UuK5DE4ns5bjXnWC6UGVVk7S2Euuls44wr4HazbDt c1pubNtOLFTwihts6X80pim4GQR6BnpAjBA==
X-Google-Smtp-Source: AGHT+IER/kW/fGYxDEdbeWX4ZE66+DIkuyBUml4UccXfaZ21cRz8tgXFFXnludHVZC2dl5zMn/AoRcfl13sdkngKB3o=
X-Received: by 2002:a17:90b:288c:b0:2a0:4ffe:98cb with SMTP id qc12-20020a17090b288c00b002a04ffe98cbmr2539005pjb.24.1712361475226; Fri, 05 Apr 2024 16:57:55 -0700 (PDT)
MIME-Version: 1.0
References: <CAM5tNy4y36AEyD5SeOZ2F1t8AYhu8-ZKPyNvCd-dmydFg1kJtA@mail.gmail.com> <CADaq8jdUd_6j0sq-1OFmtOAcX000a=2YbK3cZCg2QprLuXv3Qg@mail.gmail.com>
In-Reply-To: <CADaq8jdUd_6j0sq-1OFmtOAcX000a=2YbK3cZCg2QprLuXv3Qg@mail.gmail.com>
From: Rick Macklem <rick.macklem@gmail.com>
Date: Fri, 05 Apr 2024 16:57:44 -0700
Message-ID: <CAM5tNy5fNa3Sun4OAGsEURcf5paDZFa1m0cGudmjdhs388C=tg@mail.gmail.com>
To: David Noveck <davenoveck@gmail.com>
Cc: NFSv4 <nfsv4@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/hJxUOWyCFiqMQq7sQ2DSqnYiTe8>
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:57:57 -0000

On Fri, Apr 5, 2024 at 12:50 PM David Noveck <davenoveck@gmail.com> wrote:
>
>
>
> On Thu, Apr 4, 2024 at 7:23 PM Rick Macklem <rick.macklem@gmail.com> 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.
>
>
> Let me see if I can make this clearer in rfc5661bis-04.  Fingers croosed.
>>
>>
>> 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?
>
>
> I think that's right.
>>
>>
>> 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.
>>
>
> It seems to me that this is an oversight.
>
>>
>> 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.
>
>
> Yes.
>
>>
>> Note that, usually, a client would not be rebooting when a server is in its
>> grace period, but that could happen.
>
>
> Yes it can.  It wouldn't matter if you said "MUST NOT" or "IST STRENG VERBOTEN".
>>
>>
>> Bottom line...
>> Should a client perform Open/Claim_Delegate_Prev before or after
>> Reclaim_Complete?
>
>
> Before.
>
>>
>> And, if the answer is "after", how does the server know when a client
>> is done recovering opens/delegations via Open/Claim_Delegate_Prev?
>>
> That's why "after" is not a good answer.
>
>>
>> Thanks for any help with this, rick
>>
> Thanks for bringing this up.
First, here's some background to why I asked this...
The FreeBSD server has had a dormant implementation in it, done for
NFSv4.0. I am now working on an experimental client side caching
mechanism that caches agressively on non-volatile storage when a
delegation for the file is held by the client.
I would like to be able to recover the delegations after a client reboot,
so that the cached data still remains valid. (For the case of a write
delegation with dirty cached data, loosing the delegation leaves it
in a "very awkward situation".)
This is why I have become interested in the use of Open/Claim_delegate_prev.

For the case where the server is not in grace, doing the
Open/Claim_delegate_prev
opens before Reclaim_complete does seem appropriate and straightforward.
- The client does an ExchangeID with same co_ownerid but a different
co_verifier,
  followed by a Create_session to confirm it.
- The server marks all extant delegations for the client OLD.
- The client recovers the delegations it wants via Open/Claim_delegate_prev.
- If an Open request that conflicts with an OLD delegation is received
by the server,
  it gets NFS4ERR_DELAY.
- When the client does Reclaim_complete, all OLD delegations are discarded.
The alternative of doing them after Reclaim_complete would require some sort of
timeout on the OLD delegations (one lease time?) after which the
server would discard
them, at least if there was a conflicting Open request.

Now, for the case where the server is in grace:
- The client does an ExchangeID with same co_ownerid but a different
co_verifier,
  followed by a Create_session to confirm it.
- The server just treats this as a new clientID and there are no
delegations for the
  client to mark OLD.
Now, the client has two choices for recovering the delegations.
a) - Use Open/Claim_previous.
OR
b) - Use Open/Claim_delegate_prev (if allowed during grace).
So, if the spec. is changed to allow Claim_delegate_prev during grace, then I
think this should work as well, assuming the server is willing to handle a
Open/Claim_delegate_prev in the same manner as an Open/Claim_previous.
- Then the client would do a Reclaim_complete after recovering the delegations.

So, I think that David's proposal of allowing Open/Claim_delegate_prev during
grace and doing it before Reclaim_complete should work ok.

If what is proposed by Tom's draft can be used to indicate "client only wants a
delegation and no open" can be used for Open/Claim_delegate_prev, that would
seem a bonus.

Thanks for the comments, rick


>
>>
>> _______________________________________________
>> nfsv4 mailing list
>> nfsv4@ietf.org
>> https://www.ietf.org/mailman/listinfo/nfsv4