Re: [nfsv4] persistent sessions and compound atomicity

Trond Myklebust <trondmy@hammerspace.com> Fri, 11 December 2020 17:30 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 343DA3A0D37 for <nfsv4@ietfa.amsl.com>; Fri, 11 Dec 2020 09:30:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.101
X-Spam-Level:
X-Spam-Status: No, score=-2.101 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, SPF_PASS=-0.001, URIBL_BLOCKED=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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L8_Le46Qwcgb for <nfsv4@ietfa.amsl.com>; Fri, 11 Dec 2020 09:30:09 -0800 (PST)
Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2090.outbound.protection.outlook.com [40.107.244.90]) (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 BCDB63A0D32 for <nfsv4@ietf.org>; Fri, 11 Dec 2020 09:30:09 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iZZyXYGH7fNzRjfAC4tNeD9yk5Wm/9uSa0i84cAUovVzPbc7do7dKU/f28Aq3m1hc5yid8H8J0zy6rc17o8TVv0PIXhLQ9tZZYWvZvIfcstgWYXVOpu8mSNNTDygY8bCTjD9gCnkW11uJQ14mLg7czQd0gXCEKlYmGWb6O4kSmZPBkI0JSNb3kSAeOGo6msTkoL+sf8HR8beQkBdxRV79Hr71ulK+Tm65rvphnReMzk0ctloYeoc2PlUpmT+SVPswYdIXEgUC/HNnvHIGVAZlOcF4B8eC4kid4LJEgpkuhBRvBnzuTCT/77hMP/FKEa+kHCs3wBLJW/4PLOfHf5L4g==
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-SenderADCheck; bh=g9NnAnZV/xoEHbW2FT1REmoXYouc7GbstXRABiEJO5U=; b=ScryzI+xP3pqxYmTFb4eYVq7Xx1DTToSalRw7wWeB2FkQWmuY7uWmkRMbDPupFZLmYjr0pbr5b8Lqf8ONkYpsFsg7jRO9ps3jDqsj5aFZdFHqlVE1m1q8qUfzARRQBn75gLHUv54VedEvLqflvaGvhkr3YLqfaQrxXUPFDfNIREnE9MHopPf/4oNZLn/k5bNaWg165HCiGqn2zCpJNKIMxV7qXWDlDFT02APrPUw9YYVAtW3gSjGUN4POCUhkEMKDIgHmlAKAh72N4rT0o53x9K8BtTesu7m/A1Vg8+CaE7Sp5pKE/1ZtKClCOOAjcC1cyU+w8xO9bEREQcjZsHGpQ==
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=g9NnAnZV/xoEHbW2FT1REmoXYouc7GbstXRABiEJO5U=; b=PwdDCuyBc1aZw6Tkot9bkWg2r4QLfC3rkCNc7JELFGV3kREujPYIln2pDdNh26+5SUEUrb9Jh3H32MQ5nFs4Zn9al6IsslN3iFcfKAz6eK0ftBsIoXdJrdXXQ4feG2Y3LRqnF0WLv/DFEf4dF3TqJVmaMrIsHdb46EPSjrEmYxE=
Received: from MN2PR13MB3957.namprd13.prod.outlook.com (2603:10b6:208:263::11) by MN2PR13MB3853.namprd13.prod.outlook.com (2603:10b6:208:1e2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.7; Fri, 11 Dec 2020 17:30:05 +0000
Received: from MN2PR13MB3957.namprd13.prod.outlook.com ([fe80::e989:f666:131a:e210]) by MN2PR13MB3957.namprd13.prod.outlook.com ([fe80::e989:f666:131a:e210%9]) with mapi id 15.20.3654.016; Fri, 11 Dec 2020 17:30:05 +0000
From: Trond Myklebust <trondmy@hammerspace.com>
To: "bfields@fieldses.org" <bfields@fieldses.org>
CC: "tom@talpey.com" <tom@talpey.com>, "davenoveck@gmail.com" <davenoveck@gmail.com>, "rmacklem@uoguelph.ca" <rmacklem@uoguelph.ca>, "nfsv4@ietf.org" <nfsv4@ietf.org>
Thread-Topic: [nfsv4] persistent sessions and compound atomicity
Thread-Index: AQHWz+NDe36GgknSJ0CcdIK7zoQFVw==
Date: Fri, 11 Dec 2020 17:30:05 +0000
Message-ID: <d3781f92ca9ade22216b0829e1457266435fc136.camel@hammerspace.com>
References: <20201209002639.GC16661@fieldses.org> <93d4e52e-23e6-cf5f-4b0f-50060f4c6151@talpey.com> <20201209144927.GB23889@fieldses.org> <2d94c517-04ba-75b0-9583-4b7eb4aa8ced@talpey.com> <YQXPR0101MB096883BD0B2EBF66D12FC732DDCC0@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM> <20201209225944.GC24283@fieldses.org> <CADaq8jdYyigfkHDbAdk7uARzdSsoNHdPZdUJjPMka5_4tZ6C6Q@mail.gmail.com> <7246cdd69b6e53fee4b657d9c51a973208c96cbf.camel@gmail.com> <20201211165725.GB16050@fieldses.org>
In-Reply-To: <20201211165725.GB16050@fieldses.org>
Accept-Language: en-US, en-GB
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: fieldses.org; dkim=none (message not signed) header.d=none;fieldses.org; dmarc=none action=none header.from=hammerspace.com;
x-originating-ip: [68.36.133.222]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: b497206d-632d-45af-f6ab-08d89dfa6642
x-ms-traffictypediagnostic: MN2PR13MB3853:
x-microsoft-antispam-prvs: <MN2PR13MB385383562468297CD2652186B8CA0@MN2PR13MB3853.namprd13.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 2Kghls6OohP4/6N6/WLSfHrCmA0FB+NNz1A6VmZY2YSN2epPuWzL1TaCv0f3uuIe9HWOzjTmQlX+Fs/6FuZvo7wlRkZuVRHr483jf+akjxl7jzgB6YcSQ0K/kCgskNZeiwcp2uDyGa12BBjCVm4mi82H0z/sMyJmlHHga3lpty0dr6cxvM4dhlGA46Gj88tqfKNCQvwJQKOzqTgnmEG3/afGU6AErKskPURMvLDmjIIt0P1/bDqN8k9pElp+QRMp/r1ZIBcsvMGFSOFdK2QcnSIwP1pTvX7fnuBzzvqHVOUr4+mka817E0ZcAjzmuCz58/EEBWQADJhMFV7mAbNTqrb2yhsc0FLjhOGN8pmbYBMElP435NK18DKXUK+fyjkxjOTpUTAqVbjtA9lJBl7Xsw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR13MB3957.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(366004)(346002)(376002)(76116006)(91956017)(66556008)(66476007)(64756008)(66446008)(6486002)(66946007)(6512007)(71200400001)(2616005)(4001150100001)(86362001)(508600001)(36756003)(54906003)(4326008)(6916009)(5660300002)(2906002)(966005)(8936002)(8676002)(6506007)(26005)(83380400001)(186003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: u6zG0g6UOKqOyTmGpkzEgoDw/YQKvVI9In59moRAn8xKZf/lWdqfqMMpzFJiRRHg+cL78nkbDMZQx03kBsmj7HhIIYQ9gDcR0wy+jUI00+IlEWx0U5ZMxkQWqbEiviSSEd99asJn8lntgRh0G3iq2v48p7YICCOqZLHDIpAYiH2c1MzHTeKF3OkBMhX+S6zU0wYgGRkWhE9ADsYsgWL7gw7xeFMnCL5UVOF9PCtdO/b/AfmU4mKOHRD9YYfDCkOHWJd4yItgQlU++4FY4WXOJ+EHWV4382Lt1F9E7rPQvyAS2kDs+cXLtqbqSLqdcIomrWz1Sb463nj6e+x3JUz34xr+KTTqA8U0ky71LyGuA/tTtc07gmP0GrqoUNBXEJyCdMpC8HVDbJ8UARJc1SQII4CPFG+vm/ntPx8NTEh2UZoi1qODXNqoEFs4Xhqjy5puq0ZKo9gWX29+Hr6Wd2h4GTqaJLETnR8mJIgBtKoAbOMpTrJ4u3h64MkBpKIljUF0y3SkNJYaTd43QytNFSwc8z1B36WBeQrwDmGJOaWZ4A2HdLcAdVlUqUNPMsC4xQztsjXWg16PLtsw1AhzBD8s+Ed2GhnyLjXMuiJeIusktls0HyY1h8BLTwy/TdFmSX+jrOnH3vo8hC75GtaxW2zk1GspgU503os7dMQ1+XiUXB65trbeh6gHTVFf5uz5eSWRn++DYAxag0cnojCDKPdYOoDWjoDgnUBK6lIRe1Eov94c5RyGrliWz4EOo7gwm8yOVMrj0d8MBPTu1icyFwMwH8A3Ni8qV9BSAvCFmp+GTmXO8Er8lvkmgrtjxebMiqDMoym0z8HmWPS9euoIyJHFnTReKkAOpWue6ReTbznN4mmknWW+hXYvWQGfYjS80O/PIkz/UK7oIuql/Fc47hHZZ5xvjcfuD/9WhYKruWPC39TZbfuMh28JSwBLTy6Xozj/B5L342z+LPHs9/NyR5lPXDFgxk72xC91gMEhVzBkKHufcL2TqhRfIcetTbkVUvfG
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-ID: <04D977244499B743B512541A3F983EC1@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: MN2PR13MB3957.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b497206d-632d-45af-f6ab-08d89dfa6642
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2020 17:30:05.5267 (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: bVleLh8vLhsIyOwqSsOYGTo8Dtw7Sybi19bzqAc8rKWMfnjspb9bVKqAZYbT2xgV8GewRl3BwXvEFw6gWg8Fkw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3853
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/o9_9D8sJSLnUTPpl0gr4WSHsZFM>
Subject: Re: [nfsv4] persistent sessions and compound atomicity
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.29
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, 11 Dec 2020 17:30:14 -0000

On Fri, 2020-12-11 at 11:57 -0500, J. Bruce Fields wrote:
> On Thu, Dec 10, 2020 at 09:23:52PM -0500, Trond Myklebust wrote:
> > On Thu, 2020-12-10 at 17:07 -0500, David Noveck wrote:
> > > 
> > > 
> > > On Wed, Dec 9, 2020, 5:59 PM J. Bruce Fields
> > > <bfields@fieldses.org>
> > > wrote:
> > > > On Wed, Dec 09, 2020 at 04:43:59PM +0000, Rick Macklem wrote:
> > > > > I would say that the ATOMIC refers to the individual
> > > > > operations
> > > > of the
> > > > > compound. In other words, it must cache the reply to each
> > > > operation
> > > > > when it is completed, in the persistent cache.
> > > > > 
> > > > > Then, if a retry of the compound is received after a server
> > > > reboot,
> > > > > the reply for the first K operations that were completed
> > > > > prior to
> > > > the
> > > > > reboot are generated from the cache and the remaining N-K are
> > > > > performed on the file system to complete the reply. (At least
> > > > > for
> > > > the
> > > > > non-idempotent operations in the compound.)
> > > > > 
> > > > > For this to all work correctly, I think the server file
> > > > > system
> > > > would
> > > > > need to perform each non-idempotent operation ATOMICALLY as
> > > > > well,
> > > > such
> > > > > that after the reboot the file system is in either the pre-
> > > > operation
> > > > > or post-operation state.
> > > > 
> > > > Great, sounds like everyone agrees, I'll calm down.
> > > 
> > > I don't see the need for individual ops to be atomic especially
> > > since
> > > they (e.g. writes) are not defined as atomic in general.
> > > 
> > > I don't think we have total agreement but we are moving in the
> > > same
> > > direction.  No reason to be anything but calm.
> > 
> > in Section 2.10.6.5 of RFC5661, there is the following snippet:
> > 
> >    One way to
> >    view the problem is as a single transaction consisting of each
> >    operation in the COMPOUND followed by storing the result in
> >    persistent storage, then finally a transaction commit.  If there
> > is a
> >    failure before the transaction is committed, then the server
> > rolls
> >    back the transaction.  If the server itself fails, then when it
> >    restarts, its recovery logic could roll back the transaction
> > before
> >    starting the NFSv4.1 server.
> > 
> > Why shouldn't a client implementer reading the above be able to
> > conclude that a NFS4ERR_DEADSESSION error implies that the
> > operation
> > failed with no side-effects?
> 
> Yes--they can conclude that the one operation failed.  But previous
> operations may have succeeded and had side effects.
> 
> I had that wrong--I thought the spec said somewhere that DEADSESSION
> could only be returned to the initial SEQUENCE op, but actually it's
> quite explicit that it can be returned later:
> 
>         https://tools.ietf.org/html/rfc5661#section-18.46.4
> 
>         In the case of a partially executed COMPOUND, processing may
>         reach an operation not processed during the earlier server
>         instance, making this operation a new one and not performable
> on
>         the existing session.  In this case, NFS4ERR_DEADSESSION will
> be
>         returned from that operation.
> 
>         https://tools.ietf.org/html/rfc5661#section-15.1.11.5
> 
>         15.1.11.5.  NFS4ERR_DEADSESSION (Error Code 10078)
> 
>         The specified session is a persistent session that is dead
> and
>         does not accept new requests or perform new operations on
>         existing requests (in the case in which a request was
> partially
>         executed before server restart).
> 
> The table in https://tools.ietf.org/html/rfc5661#section-8.4.2 gives
> it
> as a valid error return for any operation, I think, except GETFH.
> 
> So actually, forget DELAY, the server returns DEADSESSION at the
> point
> it stopped processing.  (With the one exception of GETFH as otherwise
> it
> would be impossible to implement stuff like O_CREAT reliably.)
> 
> Thus the 2.10.6.5 language was clearly meant to treat each op (and
> storage of its encoded result in the persistent DRC) as a
> transaction,
> not to treat the entire compound as a transaction.

Sure. That's how I've been reading it as well.

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