Return-Path: <davenoveck@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 5F3683A0923
 for <nfsv4@ietfa.amsl.com>; Thu,  2 Jul 2020 03:07:00 -0700 (PDT)
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, 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 N9WIC6Gn6NlR for <nfsv4@ietfa.amsl.com>;
 Thu,  2 Jul 2020 03:06:58 -0700 (PDT)
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [IPv6:2a00:1450:4864:20::633])
 (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 97F413A0920
 for <nfsv4@ietf.org>; Thu,  2 Jul 2020 03:06:57 -0700 (PDT)
Received: by mail-ej1-x633.google.com with SMTP id w6so28626527ejq.6
 for <nfsv4@ietf.org>; Thu, 02 Jul 2020 03:06:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; 
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=nsLlv/QunOCitlf6rJEIZl6QJggTVoHae3Jlv4pxJu8=;
 b=JLfGpVM1xeLRUvLb2bl+jGDypmFyW9Z/ww8hcUAGWzKt2rJd31oZIdA8wZcb6b/Y80
 B85J3ZSlGXsapUEvu92GjSMnXMu34dMlRRG9Jv/PSKk3n2EFnDjFb2th4T3PdIRIidV2
 k91KhytmXm+CyQQZfGmI8pDLWSmZGA0RgXnhqfmhzMUnesoZ7XpR1C6NRYHtDUq4VK36
 DOOSo70qh6YfQp6YeHD1x/Z9JK1Npus2sMQXzGcYYxCYm9gemEjzQF83a9aLm8pmgRxS
 L1AMoAuzJlE2uGS4IxQK25cDBIxiNR+2r8Je+NBYJoPhHLs8dEKKhHdMtbkiJHgPp3dg
 XFBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=nsLlv/QunOCitlf6rJEIZl6QJggTVoHae3Jlv4pxJu8=;
 b=WgUsE9yq3p/vqe+JQQLcrTPr4YpVmW6AEUkSLrXu5TDkyjzpqhotXfbAwuj+c4hFRg
 Aw9uEJ9cnX0nHJtW93fqei/6X1UnOS4Zx6NNZ9Ab2vt1LyBcGzrr4E7BKLby68PUePV6
 iUiihI1RJPI9dImvdoRAXcTFlc7bP+j3ImTDTaeSrf1VJCo+PahTFardfCMujCUK+kgO
 caKqSm4zthoShyty/cJLmCRGQ4PtyS19aP/D6+wA3ZRmA1kRVIVcNaj8iByLxFn6Np62
 cQ35e1Y2Ftgpp2Rz5kwsuIv8s0Mz73G5EZeiuvOTu/05Rn0ejePyk49mpZEfIGjCO/KE
 6FnA==
X-Gm-Message-State: AOAM532tXpegPPPan3YED0kSY+R+cVWYkJhF+f6SnMGQfrRT8kEhnrX3
 K27n+z4tQQcbWry3zXgnlRPkdAP/M9N5u9wIZxAt9Q==
X-Google-Smtp-Source: ABdhPJzqTZ1nBXHaBBp6xsQ3uhBIgzIrOc6b49LwkGSM6ga42/Sn1Ob3aPkZ3tbHjEWm9VrJOLFUiJlpy9yYZpAffk8=
X-Received: by 2002:a17:906:284e:: with SMTP id
 s14mr25824521ejc.498.1593684416121; 
 Thu, 02 Jul 2020 03:06:56 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a17:906:dbc1:0:0:0:0 with HTTP; Thu, 2 Jul 2020 03:06:55
 -0700 (PDT)
In-Reply-To: <5d9b4f697ec698a7f07e8168f56826dbb52e234b.camel@hammerspace.com>
References: <CADaq8jev+tUs=mrGDMnZMpfmQXL=KLwDKW5S-CbBLpL-54RJTA@mail.gmail.com>
 <3fc0af37d7d870eeb6ab854a75d6eeb5aae61a0d.camel@hammerspace.com>
 <CADaq8jcb5BLiE49SyS3wxbbDmz88GJNWeLgeh5XU4oGkdBuJmw@mail.gmail.com>
 <5d9b4f697ec698a7f07e8168f56826dbb52e234b.camel@hammerspace.com>
From: David Noveck <davenoveck@gmail.com>
Date: Thu, 2 Jul 2020 06:06:55 -0400
Message-ID: <CADaq8jenX2Su1MpMGpcvMuJncoDU+JMnMmdXaED9eYXiKrnGcA@mail.gmail.com>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: "nfsv4@ietf.org" <nfsv4@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000081cf8505a972917d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/n1CX62e-DQXAIBFOhO6pCvrrV54>
Subject: Re: [nfsv4] Notes regarding discussion of directory scalabiliy
 issues
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: Thu, 02 Jul 2020 10:07:00 -0000

--00000000000081cf8505a972917d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tuesday, June 30, 2020, Trond Myklebust <trondmy@hammerspace.com> wrote:

> On Tue, 2020-06-30 at 08:40 -0400, David Noveck wrote:
>
> Thanks for your helpful comments.
>
> On Mon, Jun 29, 2020 at 2:43 PM Trond Myklebust <trondmy@hammerspace.com>
> wrote:
>
> Like it or not, the readdir cookie *is* an attribute of the directory.
>
>
> If the protocol treated them as such, then the attribute notifications
> feature could provide updates to the client.   Given that it doesn't, we
> could add a cookie update feature to directory notification feaure as a
> v4.2 extension to the protocol.  However, I'm reluctant to start work on
> the necessary protocol additions until we are sure they are needed to
> provide better directory cacheability.
>
> Actually, they are attributes of directory *streams.   *The difference is
> not all that important given that client implementations are unlikely to =
be
> aware of the specific steam associated with any particular request.
> However, there are a few cases in which the difference is important in
> determining whether various approaches to client handling of cookies migh=
t
> or might not work, and will be important in the discussion below:
>
>    - Two requests made on different clients necessarily are made on
>    distinct streams.
>    - Two requests made on different instances of the same client (with an
>    intervening restart/reboot) also have to arise on different streams.
>
>
> If I want to support the POSIX telldir() and seekdir() operations (
> https://pubs.opengroup.org/onlinepubs/9699919799/functions/seekdir.html )=
,
> then I need to ensure that when the application calls seekdir(), I return
> to the exact same cursor location in the stream that I was at when I call=
ed
> telldir().
>
>
> Agreed.
>
> Without a server side cookie on which to anchor my telldir() cookies,
>
>
> Every client has these available but it is not clear to me useful such
> anchoring is.   I think the flexibility that each client has to
> assign cookies to streams it is responsible for is valuable and could be
> compromised if anchoring to the server cookies is made the focus of the
> implementation.
>
> then all I have is a list of filenames that can and will change every tim=
e
> a file is created, deleted or renamed.
>
>
> Clearly it will change.  However, the directory notifications feature
> makes some assumptions, currently implicit about how the list will change=
.
>  Once these are made explicit, the wg could decide that server/fs pairs
> incapable of staying within these reasonable restrictions (if they are, i=
n
> fact, reasonable), cannot support the directory notifications feature.
>
> Both the length and ordering of that list may change whenever the
> directory is modified,
>
>
> Clearly the length will change, but the reasonable expectation is that
> creating a file will increase the length by one and deleting one will
> decrease it by one.   I don't see the value of supporting directory
> notifications on server fs that do something else.
>
> With regard ro ordering,  suppose the spec allows an fs to shuffle the
> directory order every time a change is made, but I'm unaware of any actua=
l
> file systems that do this.   Do we need to support directory notification=
s
> for such fs's?
>
>
>
> touch foo; touch bar; ln foo baz; rm foo; mv baz foo
>
> There... Most filesystems will end up reordering 'foo' and 'bar' in the
> directory stream given the above sequence of commands. How does the clien=
t
> figure out what happened if the above sequence of commands is performed o=
n
> the server?
> Now let's say that is a directory of a million files, and something like
> the above is made to happen regularly. How do I maintain a stable list of
> synthetic cookies on the client?
>
> I think you are right about there being cases in which it is impossible,
but we either disagree or are simply talking past one another about other
cases.

If the caching client is making the directory changes, then I agree this
cannot be done and you are stuck having to refetch potentially large
directories to deal with new READDIR requests=E2=98=B9=EF=B8=8F

Where we might disagree is the case in which another client is making the
change.  In that case directory notifications would allow you to avoid
repeated READDIR ops, whether you are providing the user synthetic or
server-based cookies.

My talk on directory caching will discuss the possibility of v4.2
extensions to address the same-client directory caching issue, as well as
possible clarifications regarding directory delegation/notification in v4.1=
.


>
> meaning that a naive implementation
>
>
> OK.   I'll plead guilty to one *misdemeanor *count of directory naivety.
>
>
> of synthetic cookies as an offset is not compatible with the
> telldir()/seekdir() requirements.
>
>
> It's not clear to me how this incompatibility would manifest itself.  I
> think I need to understand what would break.
>
>
> To make matters worse, the list size is for all intents and purposes
> unbounded, because there is no hard limit on the size of a directory. Tha=
t
> makes it also impossible to create a cached mapping between a synthetic
> cookie and a filename; such a mapping would be unbounded both in size and
> in duration (since we don't know a priori how long the application will
> keep the directory open, or for that matter, which exact set of cookies i=
t
> may have cached).
>
>
> Such a mapping would, in essence, be part of the cached directory.   So,
> if it is too big to keep in client memory,then it is too big to cache and
> you might as well decide not to cache it.
>
> I expect there is an issue that is a worry in the case in which a
> reasonably sized directory  grows over time to be too big to cache while =
an
> open directory stream retains some directory cookies which might be
> incompatible with the client dropping  caching of directories and switchi=
ng
> to server-based cookies.=F0=9F=98=96
> I feel it is reasonable to treat this situation as one might a
> cookie-verifier failure, particularly if this is the only worrisome failu=
re
> mode.   However, this possibility means that I would not ask clients to
> implement such local cookies. To enable that, we would have to make
> explicit the same sort of reasonableness requirement for cookie changes
> that we have already discussed for ordering changes.  RFC7530 already
> alludes to the need to avoid spurious cookie invalidations although not i=
n
> as explicit or strict way as we would need to support
> directory notifications:
>
>    As there is no way for the client to indicate that a cookie value,
>
>    once received, will not be subsequently used, server implementations
>
>    should avoid schemes that allocate memory corresponding to a returned
>
>    cookie.  Such allocation can be avoided if the server bases cookie
>
>    values on a value such as the offset within the directory where the
>
>    scan is to be resumed.
>
>
>    Cookies generated by such techniques should be designed to remain
>
>    valid despite modification of the associated directory.  If a server
>
>    were to invalidate a cookie because of a directory modification,
>
>    READDIRs of large directories might never finish.
>
>
>
> So in order to make this work the client would basically have to create
> its own B-tree and persist it in storage somewhere.
>
>
> I don't see the need to make this persistent.  If the client restarts, al=
l
> directory streams have ceased to exist and we know  *a posteriori  *that
> there are no outstanding directory cookies to which the client would have
> to respond.
>
> <nfsv4@ietf.org>
>
> --
>
> --
>
> Trond Myklebust
> Linux NFS client maintainer, Hammerspace
> trond.myklebust@hammerspace.com <trond.myklebust@primarydata.com>
>
>
>

--00000000000081cf8505a972917d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<br><br>On Tuesday, June 30, 2020, Trond Myklebust &lt;<a href=3D"mailto:tr=
ondmy@hammerspace.com">trondmy@hammerspace.com</a>&gt; wrote:<br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">



<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff" text=3D"#2=
e3436" link=3D"#737373" vlink=3D"#2e3436">
<div>On Tue, 2020-06-30 at 08:40 -0400, David Noveck wrote:</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div dir=3D"ltr">
<div>Thanks=C2=A0for your helpful comments.</div>
<br>
<div class=3D"gmail_quote">
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jun 29, 2020 at 2:43 PM Trond=
 Myklebust &lt;<a href=3D"mailto:trondmy@hammerspace.com" target=3D"_blank"=
>trondmy@hammerspace.com</a>&gt; wrote:<br>
</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>Like it or not, the readdir cookie=C2=A0<b>is</b>=C2=A0an attribute of=
 the directory.</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>If the protocol treated=C2=A0them as such, then the attribute notifica=
tions feature could provide updates to the client.=C2=A0 =C2=A0Given that i=
t doesn&#39;t, we could add a cookie update feature to directory notificati=
on feaure=C2=A0as a v4.2 extension to the protocol.=C2=A0 However,
 I&#39;m reluctant to start work on the necessary protocol additions until =
we are sure they are=C2=A0needed to provide better=C2=A0directory cacheabil=
ity.</div>
<div><br>
</div>
<div>Actually, they are attributes of directory <i>streams.=C2=A0 =C2=A0</i=
>The difference is not all that important=C2=A0given that client implementa=
tions are unlikely to be aware=C2=A0of the specific steam associated with a=
ny particular request.=C2=A0 However, there are a few cases
 in=C2=A0which the difference is important=C2=A0in determining whether=C2=
=A0various approaches=C2=A0to client handling=C2=A0of cookies might or migh=
t not work, and will be important in the discussion=C2=A0below:=C2=A0</div>
<div>
<ul>
<li>Two requests made on different clients necessarily are made on distinct=
 streams.</li><li>Two requests made on different instances of the same clie=
nt (with an intervening restart/reboot) also have to arise on different str=
eams.</li></ul>
</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div><br>
</div>
<div>If I want to support the POSIX telldir() and seekdir() operations (=C2=
=A0<a href=3D"https://pubs.opengroup.org/onlinepubs/9699919799/functions/se=
ekdir.html" target=3D"_blank">https://pubs.opengroup.org/<wbr>onlinepubs/96=
99919799/<wbr>functions/seekdir.html</a>=C2=A0), then I
 need to ensure that when the application calls seekdir(), I return to the =
exact same cursor location in the stream that I was at when I called telldi=
r().</div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>Agreed.=C2=A0</div>
<div><br>
</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div>Without a server side cookie on which to anchor my telldir() cookies, =
</div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>Every client has these available but it is not clear to me useful such=
 anchoring is.=C2=A0 =C2=A0I think=C2=A0the flexibility=C2=A0that each clie=
nt has to assign=C2=A0cookies to streams it is responsible for is valuable=
=C2=A0and could be compromised if anchoring to the server cookies
 is made the focus of the implementation.</div>
<div><br>
</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div>then all I have is a list of filenames that can and will change every =
time a file is created, deleted or renamed.
</div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>Clearly it will change.=C2=A0 However, the directory notifications fea=
ture makes some assumptions, currently implicit about how the list will cha=
nge.=C2=A0 =C2=A0Once these are made explicit, the wg could decide that ser=
ver/fs pairs incapable of staying=C2=A0within these
 reasonable restrictions (if they are, in fact, reasonable), cannot support=
 the directory notifications feature.</div>
<div><br>
</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div>Both the length and ordering of that list may change whenever the dire=
ctory is modified,</div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>Clearly the length will change, but the reasonable expectation is that=
 creating a file will increase the length=C2=A0by one and deleting one will=
 decrease it by one.=C2=A0 =C2=A0I don&#39;t see the value of supporting=C2=
=A0directory notifications on server fs that do something
 else.=C2=A0=C2=A0</div>
<div><br>
</div>
<div>With regard ro ordering,=C2=A0 suppose the spec allows an fs to shuffl=
e the directory order every time a change=C2=A0is made, but I&#39;m unaware=
 of any actual file systems that do this.=C2=A0 =C2=A0Do we need to support=
 directory=C2=A0notifications for such fs&#39;s?</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<div>
<div>touch foo; touch bar; ln foo baz; rm foo; mv baz foo</div>
<div><br>
</div>
<div>There... Most filesystems will end up reordering &#39;foo&#39; and &#3=
9;bar&#39; in the directory stream given the above sequence of commands. Ho=
w does the client figure out what happened if the above sequence of command=
s is performed on the server?</div>
<div>Now let&#39;s say that is a directory of a million files, and somethin=
g like the above is made to happen regularly. How do I maintain a stable li=
st of synthetic cookies on the client?</div>
</div>
<div><br>
</div></div></blockquote><div>I think you are right about there being cases=
 in which it is impossible, but we either disagree or are simply talking pa=
st one another about other cases.</div><div><br></div><div>If the caching c=
lient is making the directory changes, then I agree this cannot be done and=
 you are stuck having to refetch potentially large directories to deal with=
 new READDIR requests=E2=98=B9=EF=B8=8F</div><div><br></div><div>Where we m=
ight disagree is the case in which another client is making the change.=C2=
=A0 In that case directory notifications would allow you to avoid repeated =
READDIR ops, whether you are providing the user synthetic or server-based c=
ookies.</div><div><br></div><div>My talk on directory caching will discuss =
the possibility of v4.2 extensions to address the same-client directory cac=
hing issue, as well as possible clarifications regarding directory delegati=
on/notification in v4.1.</div><div><br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff" text=3D"#=
2e3436" link=3D"#737373" vlink=3D"#2e3436">
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div dir=3D"ltr">
<div class=3D"gmail_quote">
<div>=C2=A0</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div>meaning that a naive implementation </div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>OK.=C2=A0 =C2=A0I&#39;ll plead guilty to one <i>misdemeanor </i>count =
of directory=C2=A0naivety.</div>
<div>=C2=A0</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div>of synthetic cookies as an offset is not compatible with the telldir()=
/seekdir() requirements.</div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>It&#39;s not clear to me how this incompatibility would manifest itsel=
f.=C2=A0 I think I need to understand what would break.</div>
<div>=C2=A0</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div>To make matters worse, the list size is for all intents and purposes u=
nbounded, because there is no hard limit on the size of a directory. That m=
akes it also impossible to create a cached mapping between a synthetic cook=
ie and a filename; such a mapping
 would be unbounded both in size and in duration (since we don&#39;t know a=
 priori how long the application will keep the directory open, or for that =
matter, which exact set of cookies it may have cached).</div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>Such a mapping would, in essence, be part of the=C2=A0cached=C2=A0dire=
ctory.=C2=A0 =C2=A0So, if it is=C2=A0too big to keep in client memory,then =
it is too big to cache and you might as well decide not to cache=C2=A0it.=
=C2=A0=C2=A0</div>
<div><br>
</div>
<div>I expect there is an issue that is a worry in the case in which a reas=
onably sized=C2=A0directory=C2=A0 grows over time to be too big to cache wh=
ile an open directory stream retains some directory cookies which might be =
incompatible with the client=C2=A0dropping=C2=A0 caching
 of directories and switching to server-based cookies.=F0=9F=98=96</div>
<div>I feel it is reasonable to treat this situation as one might a cookie-=
verifier failure, particularly if this is the only worrisome=C2=A0failure m=
ode.=C2=A0 =C2=A0However, this possibility means that I would not ask clien=
ts to implement=C2=A0such local cookies. To enable that,
 we would have to make explicit the same sort of reasonableness requirement=
 for cookie changes that we have already=C2=A0discussed for ordering change=
s.=C2=A0 RFC7530 already alludes to the need to avoid spurious=C2=A0cookie=
=C2=A0invalidations although not in as explicit or strict
 way as we would need to support directory=C2=A0notifications:</div>
<div>
<div>
<pre>   As there is no way for the client to indicate that a cookie value,<=
/pre>
<pre>   once received, will not be subsequently used, server implementation=
s</pre>
<pre>   should avoid schemes that allocate memory corresponding to a return=
ed</pre>
<pre>   cookie.  Such allocation can be avoided if the server bases cookie<=
/pre>
<pre>   values on a value such as the offset within the directory where the=
</pre>
<pre>   scan is to be resumed.</pre>
<pre><br></pre>
<pre>   Cookies generated by such techniques should be designed to remain</=
pre>
<pre>   valid despite modification of the associated directory.  If a serve=
r</pre>
<pre>   were to invalidate a cookie because of a directory modification,</p=
re>
<pre>   READDIRs of large directories might never finish.</pre>
</div>
</div>
<div>=C2=A0</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<div>
<div>So in order to make this work the client would basically have to creat=
e its own B-tree and persist it in storage somewhere.
</div>
</div>
</div>
<br>
</blockquote>
<div><br>
</div>
<div>I don&#39;t see the need to make this persistent.=C2=A0 If the client =
restarts, all directory streams have ceased to exist and we know=C2=A0
<i>a posteriori=C2=A0 </i>that there are no outstanding=C2=A0directory=C2=
=A0cookies=C2=A0<wbr>to which the client would have to respond.</div>
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div style=3D"text-align:left;direction:ltr" bgcolor=3D"#ffffff">
<blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-left:2px #729fc=
f solid;padding-left:1ex">
<div dir=3D"ltr">
<div dir=3D"auto">
<div dir=3D"ltr">
<div dir=3D"auto">
<div dir=3D"ltr">
<div>
<div></div>
<div dir=3D"auto">
<div></div>
<div></div>
</div>
<div dir=3D"auto"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href=3D"mailto:nfsv4@ietf.org" target=3D"_blank"></a></blockquote>
<div><span>
<pre>-- </pre>
</span></div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<div><span>
<pre>-- <br></pre>
<div style=3D"width:71ch">Trond Myklebust</div>
<div style=3D"width:71ch">Linux NFS client maintainer, Hammerspace</div>
<div style=3D"width:71ch"><a href=3D"mailto:trond.myklebust@primarydata.com=
" target=3D"_blank">trond.myklebust@hammerspace.<wbr>com</a></div>
<div style=3D"width:71ch"><br>
</div>
<div style=3D"width:71ch"><br>
</div>
</span></div>
</div>

</blockquote>

--00000000000081cf8505a972917d--

