Re: [nfsv4] persistent sessions and compound atomicity

Trond Myklebust <trondmy@gmail.com> Fri, 11 December 2020 02:24 UTC

Return-Path: <trondmy@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 6E7553A13DD for <nfsv4@ietfa.amsl.com>; Thu, 10 Dec 2020 18:24:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7KWE6Yu7Vp0p for <nfsv4@ietfa.amsl.com>; Thu, 10 Dec 2020 18:23:59 -0800 (PST)
Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 490F73A13D6 for <nfsv4@ietf.org>; Thu, 10 Dec 2020 18:23:59 -0800 (PST)
Received: by mail-qt1-x830.google.com with SMTP id b9so5455398qtr.2 for <nfsv4@ietf.org>; Thu, 10 Dec 2020 18:23:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version; bh=RjWKGPwH1aGaQnwUHhw/cS4zBW1Td0NorliO2jjf0a4=; b=d3ML6lVKEUEfUYHhpx9kCKzodbDA5emvoj1nCwMmxFhSU532fo8m6yM31el/YAXYYd 3wh0JbhMpzJzo5jpIULcFy9gUZUIxL8a6MA2ErUd+LaPTMBbN9up5rBPtU2pJ0yAsaru RH716oHuKmlqF3yUljbxlyqQuTamdS47ARSKCyF+wXtB/drxTa/AJRZPe3pkd3rsadhD hIG/sRuTw3WgBNwa5hzSBVjgR5BgZTXQdJEmzbJ/pt3MT8ZRtAmBHlLy6tUiq1JMSzCG TOkkwQZ0J9UoKIROMXfxDVCuKFZ16dtbU4sF0qX3PN3aQpjWt9FrfkQP9a73b1gIDHlg KD0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version; bh=RjWKGPwH1aGaQnwUHhw/cS4zBW1Td0NorliO2jjf0a4=; b=ki/PPp0ihEI+eOtzDMKWY3/yqK7iEtfOekIFJpJBl4x1AfFCefVx+NXf5TWvPxKs2X yuTG8TfReHJEmT8DSG1l7LT9KbNaqNaXBad3xeKmj5K3vBeENypJdUiFr1ntI/RbWeti PVcL7WFKUeWzz6HY8W78kk0B5ibw4/Zs8JZe+cKC+7yBa0iLLOe/ZEIqleLUlpYWRpUQ RMjYeBGt4DSOSpSbqFzKQLTDjgYk1f+b2ph0uVSNSzyyzRL/XadnHeb48vH5N1N2nmq3 7/kdNxcYmTwi9JqQIP53L61n9Z/AXYhRcFKl9mSrkzBKk5l1gccD5AkquxuLkwGcsvob k9TA==
X-Gm-Message-State: AOAM533cZOoWJEcAz/SKB3KWsoXDVRP2O1pjx/WJPOPmXLGeQYklaby1 ePA95GjsNANdAqgBD1htmA==
X-Google-Smtp-Source: ABdhPJxDOVKQK3dO1PHgDCZM30WWITRI/vkk6EizZvxN7OQFCdSFbSOtQyUzD4tzI/zfk8UuFVXKoA==
X-Received: by 2002:aed:2297:: with SMTP id p23mr12729520qtc.140.1607653438075; Thu, 10 Dec 2020 18:23:58 -0800 (PST)
Received: from [192.168.75.2] (c-68-36-133-222.hsd1.mi.comcast.net. [68.36.133.222]) by smtp.gmail.com with ESMTPSA id 8sm5950047qkr.28.2020.12.10.18.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 18:23:57 -0800 (PST)
Message-ID: <7246cdd69b6e53fee4b657d9c51a973208c96cbf.camel@gmail.com>
From: Trond Myklebust <trondmy@gmail.com>
To: David Noveck <davenoveck@gmail.com>, "J. Bruce Fields" <bfields@fieldses.org>
Cc: Tom Talpey <tom@talpey.com>, Rick Macklem <rmacklem@uoguelph.ca>, "nfsv4@ietf.org" <nfsv4@ietf.org>
Date: Thu, 10 Dec 2020 21:23:52 -0500
In-Reply-To: <CADaq8jdYyigfkHDbAdk7uARzdSsoNHdPZdUJjPMka5_4tZ6C6Q@mail.gmail.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>
Content-Type: multipart/alternative; boundary="=-sdnl3AqBq9zpkBsgu5Lg"
User-Agent: Evolution 3.38.1 (3.38.1-1.fc33)
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/_Ohozk6nG9xCyrrXFP9XXFXXs0Q>
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 02:24:02 -0000

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?


> . 
> > 
> > > rick, who has no intention of ever trying to implement a
> > persistent
> > > session cache.
> 
> Your input is still valuable.
> 
> > 
> > I can't decide.  It looks like kind of a pain.  It'll require some
> > cooperation with the filesystem folks--I think it needs to be
> > integrated
> > with filesystem journaling somehow.
> 
> That makes sense.
> 
> > 
> > But I'm not looking forward to someone running into this, and
> > having to
> > say, "oh yeah, we've known about that bug for decades; just give me
> > another few months or a year, and I'll fix it right up for you...."
> 
> I have a revised version of this section in draft-dnoveck-rfc5661bis-
> 00.  (Will be out before next year).  I hope we will discuss that and
> get to a text that everybody does agree on, and might even be
> implementable :-)
> > 
> > --b.
> > 
> > _______________________________________________
> > nfsv4 mailing list
> > nfsv4@ietf.org
> > https://www.ietf.org/mailman/listinfo/nfsv4
> _______________________________________________
> nfsv4 mailing list
> nfsv4@ietf.org
> https://www.ietf.org/mailman/listinfo/nfsv4

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