From: Kai Krakow <hurikhan77@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: Need help with incremental backup strategy (snapshots, defragmentingt & performance)
Date: Fri, 17 Nov 2017 23:36:37 +0100 [thread overview]
Message-ID: <20171117233637.6a3e1ae4@jupiter.sol.kaishome.de> (raw)
In-Reply-To: d7f8d215-e845-79e6-12a9-29468287d7b9@gmail.com
Am Fri, 17 Nov 2017 06:51:52 +0300
schrieb Andrei Borzenkov <arvidjaar@gmail.com>:
> 16.11.2017 19:13, Kai Krakow пишет:
> ...
> > > BTW: From user API perspective, btrfs snapshots do not guarantee
> > perfect granular consistent backups.
>
> Is it documented somewhere? I was relying on crash-consistent
> write-order-preserving snapshots in NetApp for as long as I remember.
> And I was sure btrfs offers is as it is something obvious for
> redirect-on-write idea.
I think it has ordering guarantees, but it is not as atomic in time as
one might think. That's the point. But devs may tell better.
> > A user-level file transaction may
> > still end up only partially in the snapshot. If you are running
> > transaction sensitive applications, those usually do provide some
> > means of preparing a freeze and a thaw of transactions.
> >
>
> Is snapshot creation synchronous to know when thaw?
I think you could do "btrfs snap create", then "btrfs fs sync", and
everything should be fine.
> > I think the user transactions API which could've been used for this
> > will even be removed during the next kernel cycles. I remember
> > reiserfs4 tried to deploy something similar. But there's no
> > consistent layer in the VFS for subscribing applications to
> > filesystem snapshots so they could prepare and notify the kernel
> > when they are ready.
>
> I do not see what VFS has to do with it. NetApp works by simply
> preserving previous consistency point instead of throwing it away.
> I.e. snapshot is always last committed image on stable storage. Would
> something like this be possible on btrfs level by duplicating current
> on-disk root (sorry if I use wrong term)?
I think btrfs gives the same consistency. But the moment you issue
"btrfs snap create" may delay snapshot creation a little bit. So if
your application relies on exact point in time snapshots, you need to
ensure synchronizing your application to the filesystem. I think the
same is true for NetApp.
I just wanted to point that out because it may not be obvious, given
that btrfs snapshot creation is built right into the tool chain of
filesystem itself, unlike e.g. NetApp or LVM, or other storage layers.
Background: A good while back I was told that btrfs snapshots during
ongoing IO may result in some of the later IO carried over to before
the snapshot. Transactional ordering of IO operations is still
guaranteed but it may overlap with snapshot creation. So you can still
loose a transaction you didn't expect to loose at that point in time.
So I understood this as:
If you just want to ensure transactional integrity of your database,
you are all fine with btrfs snapshots.
But if you want to ensure that a just finished transaction makes it
into the snapshot completely, you have to sync the processes.
However, things may have changed since then.
--
Regards,
Kai
Replies to list-only preferred.
next prev parent reply other threads:[~2017-11-17 22:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-01 5:00 Need help with incremental backup strategy (snapshots, defragmentingt & performance) Dave
2017-11-01 5:15 ` Roman Mamedov
2017-11-01 6:27 ` Dave
2017-11-14 3:39 ` Dave
2017-11-14 7:14 ` Marat Khalili
2017-11-14 8:21 ` Roman Mamedov
2017-11-14 8:50 ` Roman Mamedov
2017-11-14 20:51 ` Dave
2017-11-16 16:10 ` Kai Krakow
2017-11-16 16:13 ` Kai Krakow
2017-11-17 3:51 ` Andrei Borzenkov
2017-11-17 22:36 ` Kai Krakow [this message]
2017-11-01 6:19 ` Marat Khalili
2017-11-01 6:51 ` Dave
2017-11-01 8:34 ` Marat Khalili
2017-11-01 20:27 ` Dave
2017-11-02 0:35 ` Peter Grandi
2017-11-02 20:46 ` Kai Krakow
2017-11-03 3:24 ` Dave
2017-11-03 7:06 ` Kai Krakow
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=20171117233637.6a3e1ae4@jupiter.sol.kaishome.de \
--to=hurikhan77@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).