Hacker News new | past | comments | ask | show | jobs | submit login

What would you do with a failed checksum on a filesystem level? These errors could be and likely to be transient too.



If nothing else, you can log the error. If you have RAID1 you can recopy the block from a good copy. It is, honestly, probably situation-specific, but step #1 is always going to be "identify that you have a problem"


That's the thing, identifying the problem on the filesystem level is useless if you can only correct it on another level. Unless your filesystem is distributed and self-healing, it's not a place for checksums, it must remain a thin predictable layer on top of a disk.


There absolutely is a practical use for checksums and error detection, even if you cannot do error correction.

Error detection allows you to:

* Discover and replace bad hardware (like the author of the article),

* Avoid unknowingly using invalid data for calculations or program code,

* Stop using the system and corrupting more data over time,

* Restore files from backup while still in the retention period of your backup service.

I once had a computer with a bad disk that somehow corrupted 1 bit out of about 150MB written, and probably only in some regions. I only found out after the GZip checksum of a very large downloaded file mismatched, and it took a while to figure out the real cause. By that time I had been using it for months, so it's unclear to this day what other files might have been corrupted.


ZFS is self-healing. It can automatically restore from mirror/RAID drives. And if you only have one drive, you can set a parity option so that information will be written several times, like a mirror but on one disk. (Obviously doesn't protect against a whole drive failure :D)


> That's the thing, identifying the problem on the filesystem level is useless if you can only correct it on another level.

Nope I'd take a system that can tell me "Hey sorry I don't have the right data" over "Here's some data, looks good to me" any day of the week.

Also as ProblemFactory points out, ZFS will self-heal whenever possible.


"Nope I'd take a system that can tell me "Hey sorry I don't have the right data" over "Here's some data, looks good to me" any day of the week."

Nope, it doesn't help with anything. I think you are making false assumptions about the safety of your data. Because to keep consistency such system must automatically shutdown on data corruption and only wake up once the problem is fixed. To keep availability it must automatically fix the problem. There is no third option, because filesystems are not aware of how applications use them. Returning EIO would also introduce inconsistency.

But if you actually care about your data, you shouldn't trust a single box, ever, no matter how fancy the filesystem is. There are just so many things that could go wrong, it's hard to believe someone would even take that risk.

Just a few weeks ago I saw data loss on one of the object storage nodes, because of a typical sata cable issue. It caused multiple kernel panics, affecting data on multiple disks, before I was able to figure it out. Not a problem for a distributed storage, but you wouldn't survive that with a local storage. This is also one of the reasons I consider zfs an over engineered toy, that doesn't target real world problems.


What is wrong with returning an IO error (e.g. EIO) if the data read from the disk is corrupt?


Use an error correcting code, fix errors you can fix, report unrecoverable errors to the user so that they can restore from backup.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: