On 27/11/2022 18:21, Reindl Harald wrote:
If the array is 99% full, MD or ZFS/BTRFS have
same behaviour, in terms of reliability.
If the array is 0% full, as well
you completly miss the point!
if your mdadm-array is built with 6 TB drivres wehn you replace a drive
you need to sync 6 TB no matter if 10 MB or 5 TB are actually used
And you are also completely missing the point!
When mdadm creates an array - IF IT SUPPORTED TRIM - you could tell it
"this is a blank array, don't bother initialising it". So it would
initialise an internal bitmap to say "all these stripes are empty".
As the file system above sends writes down, mdadm would update the
bitmap to say "these stripes are in use".
AND THIS IS WHAT I MEAN BY "SUPPORTING TRIM" - when the filesystem sends
a trim command, saying "I'm no longer using these blocks", MDADM WOULD
REMEMBER, and if appropriate clear the bitmap.
So when a drive breaks, mdadm would know what stripes are in use, and
what stripes to sync, and what stripes to ignore!
And no, you are COMPLETELY WRONG in assuming that the only block layers
that implement trim is hardware. Any block layer that wants to can
implement trim - there is no reason whatsoever why mdadm couldn't. I
never said it had, I said I wish it did.
But if virtual file system layers did NOT implement trim, you'd have a
lot of unhappy punters on Amazon Cloud, or Google Cloud, or whatever
these other suppliers of virtual systems are, if they had to pay for all
that disk storage they're not actually using, because their virtual hard
disks couldn't free up empty space.
tldr - there is no reason why mdadm couldn't implement trim, and if it
did, then it would know how much of the array needed to be sync'd and
how much didn't need bothering with.
Cheers,
Wol