Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* Snapshots, Dirty Data, and Power Failure
@ 2020-11-24 16:03 Ellis H. Wilson III
  2020-11-25  4:24 ` Zygo Blaxell
  0 siblings, 1 reply; 5+ messages in thread
From: Ellis H. Wilson III @ 2020-11-24 16:03 UTC (permalink / raw)
  To: Btrfs BTRFS

Hi all,

Back with more esoteric questions.  We find that snapshots on an idle 
BTRFS subvolume are extremely fast, but if there is plenty of data 
in-flight (i.e., in the buffer cache and not yet sync'd down) it can 
take dozens of seconds to a minute or so for the snapshot to return 
successfully.

I presume this delay is for the data that was accepted but not yet 
sync'd to disk to get flushed out prior to taking the snapshot. 
However, I don't have details to answer the following questions aside 
from spending a long time in the code:

1. Is my presumption just incorrect and there is some other 
time-consuming mechanics taking place during a snapshot that would cause 
these longer times for it to return successfully?

2. If I snapshot subvol A and it has dirty data outstanding, what power 
failure guarantees do I have after the snapshot completes?  Is 
everything that was written to subvol A prior to the snapshot guaranteed 
to be safely on-disk following the successful snapshot?

3. If I snapshot subvol A, and unrelated subvol B has dirty data 
outstanding in the buffer cache, does the snapshot of A first flush out 
the dirty data to subvol B prior to taking the snapshot?  In other 
words, does a snapshot of a BTRFS subvolume require all dirty data for 
all other subvolumes in the filesystem to be sync'd, and if so, is all 
previously written data (even to subvol B) power-fail protected 
following the successful snapshot completion of A?

4. Is there any way to efficiently take a snapshot of a bunch of 
subvolumes at once?  If the answer to #2 is that all dirty data is 
sync'd for all subvolumes for a snapshot of any subvolume, we're liable 
to have significantly less to do on the consecutive subvolumes that are 
getting snapshotted right afterwards, but I believe these still imply a 
BTRFS root commit, and as such can be expensive in terms of disk I/O (at 
least linear with the number of 'simultaneous' snapshots).

Thanks as always,

ellis

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-26 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-24 16:03 Snapshots, Dirty Data, and Power Failure Ellis H. Wilson III
2020-11-25  4:24 ` Zygo Blaxell
2020-11-25 15:16   ` Ellis H. Wilson III
2020-11-26 14:15     ` Ellis H. Wilson III
2020-11-26 15:10       ` Zygo Blaxell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox