All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Timo Rothenpieler <timo@rothenpieler.org>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: NFSD Regression: client observing a file while other client writes to it leads to stale local cache
Date: Fri, 5 Mar 2021 17:31:41 -0500	[thread overview]
Message-ID: <20210305223141.GD3813@fieldses.org> (raw)
In-Reply-To: <20210304144228.GD17512@fieldses.org>

On Thu, Mar 04, 2021 at 09:42:28AM -0500, J. Bruce Fields wrote:
> On Tue, Mar 02, 2021 at 02:23:05AM +0100, Timo Rothenpieler wrote:
> > Server and reading client disagreeing about the files size and
> > contents is 100% reproducible, even after the writing client has
> > long and definitely closed the file.
> 
> OK, I reproduced this myself and watched the network traffic in
> Wireshark.
> 
> The server is *not* giving out a read delegation to the writer (which is
> what the commit you bisected to should have allowed).  It *is* giving
> out a delegation to the reader.  Which is a truly awful bug.
> Investigating....

Yeah, it's completely failing to provide close-to-open cache consistency
there in most cases.  Arghh.

I have some idea how to fix it, but for now it should just be reverted.
I'll post that pending some testing.

I've also added a pynfs test for this case (4.1 test DELEG9).  We should
probably have some more.

So, thanks for the report.

I'd still be a little cautious about your use--NFS can't give you a lot
of guarantees when you've got a file open for read and write
simultaneously.  The writing client can delay those writes at least
until the writing application closes, and the reading isn't necessarily
going to revalidate its cache until it the reading application closes
and reopens.  And weirder behavior is possible: for exapmle when the
writer does write back, I don't think there's any guarantee it will
write in order, so you could end up temporarily with NULLs in the
middle.

But that particular regression was my fault, thanks again for bisecting
and reporting.

--b.

  reply	other threads:[~2021-03-05 22:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-28 22:27 NFSD Regression: client observing a file while other client writes to it leads to stale local cache Timo Rothenpieler
2021-03-01 18:46 ` J. Bruce Fields
2021-03-02  1:03   ` Timo Rothenpieler
2021-03-02  1:06     ` J. Bruce Fields
2021-03-02  1:23       ` Timo Rothenpieler
2021-03-04 14:42         ` J. Bruce Fields
2021-03-05 22:31           ` J. Bruce Fields [this message]
2021-03-06  0:01             ` Timo Rothenpieler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210305223141.GD3813@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=timo@rothenpieler.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.