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

Trond Myklebust <trondmy@hammerspace.com> Sat, 06 April 2024 03:02 UTC

Return-Path: <trondmy@hammerspace.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 7C7E4C1519B6 for <nfsv4@ietfa.amsl.com>; Fri, 5 Apr 2024 20:02:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 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, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=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 (1024-bit key) header.d=hammerspace.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 LfJDr3RQTC9W for <nfsv4@ietfa.amsl.com>; Fri, 5 Apr 2024 20:02:31 -0700 (PDT)
Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2133.outbound.protection.outlook.com [40.107.237.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4DF48C14F5ED for <nfsv4@ietf.org>; Fri, 5 Apr 2024 20:02:30 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Le8zP6TkBLOqiiy0R0KHBFTph6i7FGavv8Djvam5NHBglx+ll9qCNa4ReItKQkuInbKmQGnjX/2qjzy5W1yzsP0RPdlcicAzk8bLn83aPXgeaBS/kF805T66KO4/v8CS70bUZ/SZWsgoMbkr/oOntyL2tloC/x0T9pD5rfT4AgQyZEnCz+kXZqNmsowvj7koWHQhSNbBm5ZXZwVndF1ylwy5FNaRux09Tc3IYXGBLdgbZkCWfn+Sel6OuSZPQ2zDrf0LQsGaFIByNe/Gz5KZqVNiFBjHeed+RzKW/a+2CrsYvquES8+/tHZ1+B8hLTwNiWP9skk6efThHZpJyCNGaw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tO716TIad8AIRL9pxplXKMfd1wm7RZsRmjcM6djDk4o=; b=YxLZx2KPLjC51x+KUrFWSKBLmXLoBbqvrhAlMnRD9nVOjWxi4WrcMami3UyHeMZ+QZDO9iZeYOB+Exbp7ZwpCD1LsxXEV4YybnkkHjjjRcAGQL4gKNXBSJdLDLpolkNuSWFaTGsargy/Arxs9ELFuUtaT4AK3f5CtqL6kEKg/y4qgSa2ZTdpfb7D4kaFlbtcMgfKVGteeeIk/SsWREnnb3pc1CZ/g22ScmBQrgAmlAyGaJFLUGfDIAZp7Eao7X1oOzI8OluJkLpQhFcOAD17mlpzx40uVXPrQ8W115UishdNKK2lGozfVRBKd3UIqzrDt9c679QRHX5FfC7o3lWv8g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hammerspace.com; dmarc=pass action=none header.from=hammerspace.com; dkim=pass header.d=hammerspace.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tO716TIad8AIRL9pxplXKMfd1wm7RZsRmjcM6djDk4o=; b=KigMtDk+gLMOyZ6+V1nNi70s9rBccYnvJVcmT0KVgGk4b8byyi2+SjTyLlW62ZiTRBBvl4znLRnOB3FgmMV79j7kB58L7F0i+tWK8K1kX4trvCFpKwFIN5CmGbwciaOJ3UnpJrqgiMoZEhu76QBe7NxzXu6pueCU0f0gAJfkhu4=
Received: from CH0PR13MB5084.namprd13.prod.outlook.com (2603:10b6:610:111::7) by MW4PR13MB5626.namprd13.prod.outlook.com (2603:10b6:303:182::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Sat, 6 Apr 2024 03:02:27 +0000
Received: from CH0PR13MB5084.namprd13.prod.outlook.com ([fe80::5bb5:501a:fb40:5057]) by CH0PR13MB5084.namprd13.prod.outlook.com ([fe80::5bb5:501a:fb40:5057%6]) with mapi id 15.20.7409.042; Sat, 6 Apr 2024 03:02:26 +0000
From: Trond Myklebust <trondmy@hammerspace.com>
To: "rick.macklem@gmail.com" <rick.macklem@gmail.com>
CC: "nfsv4@ietf.org" <nfsv4@ietf.org>
Thread-Topic: [nfsv4] RFC: Is Open/Claim_Delegate_Prev done before/after Reclaim_complete?
Thread-Index: AQHahxBMvCkGUO5qpkColHKPwUmNU7FaT3oAgABAGAA=
Date: Sat, 06 Apr 2024 03:02:26 +0000
Message-ID: <0d1c12d3e85a5feb165c13b44b0f25111224166f.camel@hammerspace.com>
References: <CAM5tNy4y36AEyD5SeOZ2F1t8AYhu8-ZKPyNvCd-dmydFg1kJtA@mail.gmail.com> <19e3502ca1859608975bd17dc18e6774bf0bfab3.camel@hammerspace.com> <CAM5tNy41j0BLi0ixu=VA_rT14GxL7ZKKwbSyb1UAgf-xAE8m+g@mail.gmail.com>
In-Reply-To: <CAM5tNy41j0BLi0ixu=VA_rT14GxL7ZKKwbSyb1UAgf-xAE8m+g@mail.gmail.com>
Accept-Language: en-US, en-GB
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CH0PR13MB5084:EE_|MW4PR13MB5626:EE_
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: I99xgG24gxzSwz09tOJrmIZ0PlJWSSFL4W6/8UiyJNBL3j4KgXeOXI617Es1sFUldNXs2jOyRChKyQqd+SVkrVX+/wQ2HCXcpjYwz5zoKJpbfXxwfTRV/4WtOcbxNQjEcv5ganXgHHX+AJwqZjgzar1SKEvoev/VLFolE3mvf7//RvFJl0p9ZXTh9dbCDUzpIimoSqZlHfty2yp2k9sYURw7nYvuKpsNvBnCzpEIX1R4eDmeKcgcT/K/ifmdKsOvp0XbNvtZt7h4jhID3RsMsUNjvX/dSkUdNU5dG2Ydsb6vmTeKdGRGB3XvWqRSeTxyfr804gYhq8y+EtyK1x8DcmSh1d6LTCrZ8PJep3UIfmZlSUnizKoBvjfV48nW3v8QxB4bdhs61n3tfvAoVr/nvMNJIxWExuHiGl3eIesTGYIoNcpl6BtqWtqWM8l11c3Js4Pevt66Iyad4bcERO6PB8G7iiq/+VOz6wSac1Y0LAjrygdZjUwez3dHzTlAm/ImI3toXXceSFOaukZ0pldQCcc/ab80mS2Zch8bKPt8zyiXq9nE+VKuLg6wsvysWDhDFiUcKUppM/a2d8oBQtViRCuCRGQTnQyjoT8A4s716j/5LqGHM2XkCaweGACnwd9K4Kw9xOyCyhJI2S8al0vHtBh6fs117qMqeuao6dkCasY=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR13MB5084.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: O3f5Y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uC5WGTDfIkiSImiofdS04xEIuyTSCNvxCz7DxCzIjzFm59IjVCJxdBJNscfLSdFAcqgJYVxsaNS5a8nDkdzawDCGNhUWbGgSQ/+YP6oLLmk8irMD2q2uJa+RAfenjM4hdjJk2tTHqGFgkpi4f77WeFB90gPHoH48ByvK7w/uzrh9+moF3cUK5dFPcMmEgUsbNB9OnfhRrFGMJkSQOvWdOYSFD+ahTMpTl9ImNPWRGr1twd83dYJbXhkIBsc3zfcuEEWZDPPjRw3L1PKQgZ/Npjs1DVjQVXuzPfjIraDmT/AWiSO72yrIAvk+xXqi4TOzBz6ahLpn1KAorMXkYipXFFGXMPwkjb6wdg3Y1sJqklMMBriP22uFmAN/914fnluR5D+yG49zdQPkfz1jOPsmgI5Nu9NS781g204ln2CC/0uVXeok/pgrtEi6+P/P6ItxcKgcraclDXghZLIFhj92QyegGJxkYE6//dHTr8dvH+2P37xSDNsoGM53vcru2zLazQnhWR4td6w0BT6UjxG00HwVlejrAvnuGFx15c35w7dl+jhmPHZfoElIs1Ffx8azoDBlAet8wa/ZJ1mSVdVVQoNYQ6Q==
Content-Type: text/plain; charset="utf-8"
Content-ID: <BC10D65C1872914C85D33203AD602E6E@namprd13.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: hammerspace.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CH0PR13MB5084.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d346a3b7-852f-46ce-4be1-08dc55e5fd27
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2024 03:02:26.2399 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 0d4fed5c-3a70-46fe-9430-ece41741f59e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: En8pW8+b8fUjlG/qUogWJaHthI1hYucX0NhR8CdMPThmLGJczuI7PMk1+Gd/bzDrGb0RHhkKhwRhdOo0JDeIhQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR13MB5626
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/lfx4HYz31kcYjF9WzPqwZL51xe0>
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: Sat, 06 Apr 2024 03:02:35 -0000

On Fri, 2024-04-05 at 16:13 -0700, Rick Macklem wrote:
> 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.)

I see. So how do you plan to deal with the case where the server denies
the request for a delegation? Will your client just toss away the dirty
data?

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com