Re: RAID-6 and write hole with write-intent bitmap

Wols Lists
2020-11-24T10:11:06Z

On 24/11/20 07:20, Mukund Sivaraman wrote:
> Hi all
>
> I am trying to setup a MD RAID-6 array and use the ext4 filesystem in
> ordered mode (default) on it. The data gets backed up periodically. I
> want the array to be always available.
>
> I prefer not using a write-journal if it is sufficient for my usage. I
> want to use the write-intent bitmap only. AIUI the write-hole problem
> occurs when there is a crash or abrupt power off *and* disk failures.

No, I don't think so. I'm not sure, but aiui, there is a critical point
where the data is partially saved to disk, and should a power failure
occur at that precise point you have a stripe incompletely saved, and
therefore corrupt. This is why you need a log to fix it ...
>
> * After a crash or abrupt power off, the write-intent bitmap is used to
> rewrite parity where necessary. If there is no disk failure during
> this period, is the RAID-6 array guaranteed to recover without
> corruption?
>
> With RAID-6, will recovery with write-intent bitmap succeed with 1
> disk failure during the recovery period without a write-journal? i.e.,
> is there a possibility of write hole with 1 disk failure in a RAID-6
> array?
>
> * With RAID-6 with write-intent bitmap in use, ext4 in ordered mode, no
> disk failures, and abrupt power loss, is there any chance of data loss
> in files other than those being written to just before the power loss?

Probably. Sod's law, you will have other files on the same stripe and
things could go wrong ... Plus I believe some file systems (including
ext4?) store small files in the directory, not as their own i-node, so
there's a whole bunch of other complications possible, plus if you
corrupt the directory ,,,
>
> (Apologies if these are silly questions, but I request answers.)
>
RULE 0: RAID IS NO SUBSTITUTE FOR BACKUPS.

And if you don't want to lose live data as it is being updated, you need
a journal. Run the correct horse for the course :-)

Cheers.
Wol