Hello,
On Fri, Oct 14, 2022 at 04:39:42PM +0100, Andy Bennett via BitFolk Users wrote:
Do you have a hardware controller with non-volatile /
battery backed cache
memory?
Traditionally, that's been the only way to avoid the "RAID-5 write hole"
(where you only write a portion of the stripe before a power failure,
creating an undetectable data error).
Is the RAID-5 write hole not solvable in software? For a long time,
Linux MD parity RAIDs (so -4, -5, -6) have defaulted to using a
write-through cache which is supposed to solve the write hole:
https://www.kernel.org/doc/Documentation/md/raid5-cache.txt
https://lwn.net/Articles/665299/
I thought that non-volatile cache on RAID controllers was so that
you could safely accelerate writes as otherwise you have to disable
the write cache that is in the HDDs themselves as they won't survive
a power loss (and is also how the software in hardware RAID
controllers closes the parity write hole).
If not using traditional RAID (hardware or software), it depends.
ZFS solved the parity write hole by using copy-on-write:
https://pthree.org/2012/12/05/zfs-administration-part-ii-raidz/
notably btrfs has not yet solved it for the parity-based redundancy
levels, and that is one of the reasons why parity-based redundancy
in btrfs is not recommended even as recently as last week:
https://lore.kernel.org/linux-btrfs/86f8b839-da7f-aa19-d824-06926db13675@gm…
But anyway, I don't think people using MD Linux RAID-5 on a modern
kernel with HDD write caches disabled need to worry about about
write hole, unless they specifically went out of their way to
disable the MD cache.
HDD write caches default to "on", by the way…
Cheers,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting