All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: The FAQ on fsync/O_SYNC
Date: Mon, 20 Apr 2015 06:07:09 +0000 (UTC)	[thread overview]
Message-ID: <pan$f3383$b95d8948$e810e90b$680e5c5d@cox.net> (raw)
In-Reply-To: 20150420042731.GA20194@hungrycats.org

Zygo Blaxell posted on Mon, 20 Apr 2015 00:27:31 -0400 as excerpted:

> Normal writes to btrfs filesystems using the versioned filesystem tree
> are consistent(ish), atomic, and durable; however, they have high
> latency as the filesystem normally delays commit until triggered by a
> periodic timer (or sync()--not fsync), then writes all outstanding dirty
> pages in memory.
> 
> btrfs handles fsync separately from the main versioned filesystem tree
> in order to decrease the latency of fsync operations.  There is a 'log
> tree' which behaves like a journal and contains data flushed with
> fsync() since the last fully committed btrfs root.  After a crash,
> assuming no bugs, the log is replayed over the last committed version of
> the filesystem tree to implement fsync durability.
> 
> Unfortunately, in my experience, the log tree's most noticeable effect
> at the moment seems to be to add a crapton of special-case code paths,
> many of which do contain bugs, which are being fixed one at a time by
> btrfs developers.  :-/

Thanks, Zygo.  That's the clearest explanation I've seen on why the 
supposedly atomic-commit btrfs still has a log, and what it actually 
does.  I wasn't entirely clear on that, myself.

Meanwhile, yes, log-replay bugs do seem to be one of the sore spots ATM.  
I'm glad it's getting some focus now.  It needed it.

>> >> Is that statement still true in recent BTRFS versions (3.18, etc)?
> 
> 3.18 was released 133 days ago.  It has only been 49 days since the last
> commit that fixes a btrfs data loss bug involving fsync (3a8b36f on Mar
> 1, appearing in mainline as of v4.0-rc3), and 27 days since a commit
> that fixes a problem involving fsync and discard (dcc82f4 on Mar 23,
> queued for v4.1).
> 
> There has been a stream of fsync fixes in the past year, but it would be
> naive to believe that there are not still more bugs to be found given
> the frequency and recentness of fixes.

Telling commentary on what is "recent" in btrfs context, vs. what is 
"recent" in many distro's context, particularly in "enterprise" distro 
context. =8^0

4.0 is out.  There's reason people may want to stick one version back by 
default, to 3.19 currently, since it can take a few weeks for early 
reports to develop into a coherent problem, and sticking one stable 
series back allows for that, and deciding exactly when one is comfortable 
upgrading.  But in btrfs context anyway, with 4.0 out, if you're not on 
at least 3.19 yet, you should be able to point to the bug explaining
/why/.  If you can't, arguably, you should be either upgrading yesterday 
if not sooner, or you really should choose some other filesystem, as 
btrfs simply isn't at the stability required for your use-case yet, and 
you unnecessarily risk data loss to already found and fixed bugs as a 
result.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


  reply	other threads:[~2015-04-20  6:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-19 13:20 The FAQ on fsync/O_SYNC Craig Ringer
2015-04-19 14:28 ` Martin Steigerwald
2015-04-19 14:31   ` Craig Ringer
2015-04-19 15:10     ` Martin Steigerwald
2015-04-19 15:18       ` Hugo Mills
2015-04-19 17:50         ` Martin Steigerwald
2015-04-19 18:18           ` Hugo Mills
2015-04-19 18:41             ` Martin Steigerwald
2015-04-19 18:51               ` Hugo Mills
2015-04-19 15:28     ` Russell Coker
2015-04-20  4:27     ` Zygo Blaxell
2015-04-20  6:07       ` Duncan [this message]
2015-04-21  1:31         ` Zygo Blaxell
2015-04-20  8:13       ` Gian-Carlo Pascutto
2015-04-20 15:19         ` Zygo Blaxell
2015-04-21 19:07       ` Chris Murphy
2015-04-20  3:29 ` Craig Ringer

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='pan$f3383$b95d8948$e810e90b$680e5c5d@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --cc=linux-btrfs@vger.kernel.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.