From: Jeff Layton <jlayton@kernel.org>
To: Andres Freund <andres@anarazel.de>
Cc: fstests@vger.kernel.org, eguan@redhat.com, willy@infradead.org,
david@fromorbit.com
Subject: Re: [PATCH] generic: test for seeing unseen fsync errors on newly open files
Date: Fri, 27 Apr 2018 13:20:24 -0400 [thread overview]
Message-ID: <1524849624.4206.7.camel@kernel.org> (raw)
In-Reply-To: <20180427165830.xekrvdv2my6nxjsr@alap3.anarazel.de>
On Fri, 2018-04-27 at 09:58 -0700, Andres Freund wrote:
> Hi,
>
> On 2018-04-27 12:38:33 -0400, Jeff Layton wrote:
> > This is motivated by some rather odd behavior done by the PostgreSQL
> > project. The main database writers will offload the fsync calls to a
> > separate process, which can open files after a writeback error has
> > already occurred.
>
> ;)
>
>
> > + ret = pwrite(fd1, buf, bufsize, 0);
> > + if (ret < 0) {
> > + printf("Second write on fd1 failed: %m\n");
> > + return 1;
> > + }
> > +
> > + /* Ensure writeback occurs, but don't scrape the error */
> > + sync();
>
> It might be a good idea to also add a second version of this that
> additionally evicts inodes after the sync? I think that should be
> simulatable with "echo 2 > /proc/sys/vm/drop_caches" or such? That'd
> obviously fail for now...
>
We could. In this test, I'm explicitly holding the fd1 open it while we
open fd2 after the sync to ensure that it sticks around in the cache.
TBH: I'm a little leery of keeping inodes with errors on them in the
cache as it seems like an open-ended commitment. We may not be able to
keep them forever and may eventually have to eliminate some in order to
make forward progress.
If we do go that route, we may very well need drop_caches to purge
those inodes as well, to give admins a way to clear such inodes
globally without having to explicitly open+fsync them.
In any case, I'd prefer to wait until we at least have a proposed patch
for that piece before we go adding tests for it.
> Thanks for the test,
>
> Andres Freund
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-04-27 17:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-27 16:38 [PATCH] generic: test for seeing unseen fsync errors on newly open files Jeff Layton
2018-04-27 16:58 ` Andres Freund
2018-04-27 17:20 ` Jeff Layton [this message]
2018-04-28 7:27 ` Amir Goldstein
2018-04-28 12:05 ` Jeff Layton
2018-04-28 14:59 ` [PATCH v2] " Jeff Layton
2018-04-28 15:19 ` Amir Goldstein
2018-04-28 23:06 ` [PATCH v3] " Jeff Layton
2018-05-02 5:50 ` Eryu Guan
2018-05-08 12:46 ` Jeff Layton
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=1524849624.4206.7.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=andres@anarazel.de \
--cc=david@fromorbit.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox