Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* Superblock update: Is there really any benefits of updating synchronously?
@ 2018-01-23  7:03 waxhead
  2018-01-23  9:03 ` Nikolay Borisov
  0 siblings, 1 reply; 8+ messages in thread
From: waxhead @ 2018-01-23  7:03 UTC (permalink / raw)
  To: Btrfs BTRFS

Note: This have been mentioned before, but since I see some issues 
related to superblocks I think it would be good to bring up the question 
again.

According to the information found in the wiki: 
https://btrfs.wiki.kernel.org/index.php/On-disk_Format#Superblock

The superblocks are updated synchronously on HDD's and one after each 
other on SSD's.

Superblocks are also (to my knowledge) not protected by copy-on-write 
and are read-modify-update.

On a storage device with >256GB there will be three superblocks.

BTRFS will always prefer the superblock with the highest generation 
number providing that the checksum is good.

On the list there seem to be a few incidents where the superblocks have 
gone toast and I am pondering what (if any) benefits there is by 
updating the superblocks synchronously.

The superblock is checkpoint'ed every 30 seconds by default and if 
someone pulls the plug (poweroutage) on HDD's then a synchronous write 
depending on (the quality of) your hardware may perhaps ruin all the 
superblock copies in one go. E.g. Copy A,B and C will all be updated at 30s.

On SSD's, since one superblock is updated after other it would mean that 
using the default 30 second checkpoint Copy A=30s, Copy B=1m, Copy C=1m30s

Why is the SSD method not used on harddrives also?! If two superblocks 
are toast you would at maximum loose 1m30s by default , and if this is 
considered a problem then you can always adjust downwards the commit 
time. If this is set to 15 seconds you would still only loose 30 seconds 
of "action time" and would in my opinion be far better off from a 
reliability point of view than having to update multiple superblocks at 
the same time. I can't see why on earth updating all superblocks at the 
same time would have any benefits.

So this all boils down to the questions three (ere the other side will 
see..... :P )

1. What are the benefits of updating all superblocks at the same time? 
(Just imagine if your memory is bad - you could risk updating all 
superblocks simultaneously with kebab'ed data).

2. What would the negative consequences be by using the SSD scheme also 
for harddisks? Especially if the commit time is set to 15s instead of 30s

3. In a RAID1 / 10 / 5 / 6 like setup. Would a set of corrupt 
superblocks on a single drive be recoverable from other disks or do the 
superblocks need to be intact on the (possibly) damaged drive?
(If the superblocks are needed then why would not SSD mode be better 
especially if the drive is partly working)


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

end of thread, other threads:[~2018-01-24 21:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23  7:03 Superblock update: Is there really any benefits of updating synchronously? waxhead
2018-01-23  9:03 ` Nikolay Borisov
2018-01-23 14:20   ` Hans van Kranenburg
2018-01-23 14:48     ` Nikolay Borisov
2018-01-23 19:51       ` waxhead
2018-01-24  0:04         ` Hans van Kranenburg
2018-01-24 18:54           ` waxhead
2018-01-24 21:00             ` Hans van Kranenburg

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