Iām tired. My coffee isnāt helping. Pardon this thread, which may in fact be nothing more than rambling nonsense.
SSDs, whether they use the NVMe or SATA interface, whether they are in the 2.5" or m.2 form-factor, have something called āavailable spare spaceā or āspare cellsā.
Am I right so far?
If no, please correct me.
If yes, please continue.
The āspare spaceā in an SSD is not used for wear-leveling. In fact, itās exclusively used in the event of I/O errors. (Write errors? Read errors? Hold on to this thought, since Iāll revisit it later in this post when I bring up ZFS.)
Am I right so far?
If no, please correct me.
If yes, please continue.
An SSDās āspare spaceā is essentially the same as an HDDās āspare sectorsā, correct? Meaning that when an SSD has to eat into its āspare spaceā, itās really not much different than what an HDD does when it comes across bad sector, which it then ārelocatesā to a āspareā sector?
Is there a fundamental difference between an SSD employing its āspare spaceā when compared to an HDD employing ārelocatedā sectors? It seems like itās the same exact thing.
Am I right so far?
If no, please correct me.
If yes, please continue.
The above all assumes a single drive, regardless of the filesystem.
But then how does ZFS redundancy work with this?
Upon coming across a āreadā or āchecksumā error on a block, it obviously has a āgood copyā of this block (mirror vdev) or is able to ārecreateā this block via parity information (RAIDZ vdev).
I would assume that ZFS attempts to āre-writeā the good block on the problematic drive.
Does the SSD drive immediately employ its āspare spaceā, in the same way that an HDD treats ābad blocksā?
Does using ZFS change anything? (That is, the act of ZFS coming across a block that is unreadable or ācorruptā means its attempt to āre-writeā a good copy of the block immediately gets intercepted and placed into the āavailable spare spaceā area of the SSD?)
Is there anything unique about ZFS in which it ignores the logical block address (of the currently corrupt/unreadable data) and simply tries to write the āgood copyā at a different LBA? (That is, the SSD does not employ its āavailable spare spaceā, but rather ZFS writes to a normal area, as with any other new writes.)
Does this mean that it leaves it up to the driveās firmware to ādeal withā the bad cell/sector at some later point in time?
If ZFS reports a āchecksumā error, even though the block is āreadableā, does the SSD not know about this, and thus it does not employ its āavailable spare spaceā, since ZFS can simply just write a āgood copyā of the block elsewhere on the SSD? Or does ZFS do something with the corrupted block to signal to the SSDās firmware āHey, youāve got a problem here. You should mark this cell as ābadā and use your āavailable spare spaceā.ā