News for hackers. Stuff that matters.
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by thrtythreeforty on Wednesday November 22, 2023 @10:25AM (#38380494)
I was glad for this feature to land, but being conservative with my main storage array, I decided not to immediately jump on this. Prudence pays off I guess.

That said, for my main workstation, I plan to migrate to bcachefs very quickly once it's mainlined. I haven't done enough introspection to be able to tell you why I can hold both opinions in my head so well.

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by ryao on Wednesday November 22, 2023 @11:38AM (#38381481)
Kent does plenty of things right during the development process, but having a decade of experience contributing to OpenZFS/ZFSOnLinux, I can say that I will be very surprised if everything goes as well as people seem to think. There are many bugs in a complex code base and a simple 10x increase in userbase will undoubtably result in more reports of people hitting them.

That said, I think he is laying a good foundation (from what I have heard/read about his development process), but there are many times when the best of us have been confident in code that turned out to have problems and I doubt he is an exception to this.

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by j1elo on Wednesday November 22, 2023 @12:26PM (#38382129)
> he is laying a good foundation (from what I have heard/read about his development process)

Could you please share some blog or resource to read a bit about his dev process myself? That stuff usually interests me, to improve my own process.

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by ryao on Wednesday November 22, 2023 @01:25PM (#38383010)
It is mostly from external observation. He seems to be the reason that bcachefs isn't being shipped in production today, as he is trying to work through all of his backlog rather than shipping it in a WIP state. This is very different than how developers of a certain filesystem in Linux's kernel source tree that I shall not name do things. If I recall correclty, a developer of that filesystem told me several years ago that if they did not ship the code for users to use it, they would not find bugs. That file system is not much less buggy today than it was back then. :/
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by WD40ForRust2 on Wednesday November 22, 2023 @02:18PM (#38383788)
btrfs
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by viraptor on Wednesday November 22, 2023 @02:09PM (#38383659)
So the bcachefs is built on the basics of bcache which existed on its own as a block layer and worked in production for many years. This is layering that doesn't really exist in other filesystems. Not sure if that's what the parent meant.
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by ryao on Wednesday November 22, 2023 @04:01PM (#38385049)
That is not quite what I meant. Not shipping premature code that you know needs more work is something to be admired. It is something I wish more developers would do.

Anyway, it has a while since I read anything about bcachefs, but what I have read stuck me as being consistent with doing things well. For example, he is working on having an automated test suite in place before he ships it, which is a great thing to see:

https://lwn.net/Articles/934692/

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by csdvrx on Wednesday November 22, 2023 @02:02PM (#38383585)
> That said, I think he is laying a good foundation (from what I have heard/read about his development process), but there are many times when the best of us have been confident in code that turned out to have problems and I doubt he is an exception to this.

For mixed storages, bcachefs will be interesting.

For RAID1, another option is any filesystem over dm-integrity over mdadm: dm-integrity can protect against silent file corruption if used below the mdadm level: any filesystem reading inconsistent data + checksum at dm-integrity level would cause dm-integrity to give a EILSEQ to mdadm, which should recover data from the mirrors.

It's done with a cryptsetup step, and explained on https://gist.github.com/MawKKe/caa2bbf7edcc072129d73b61ae781...

Main advantages:

1. it's a "bring your own filesystem" (ex: XFS, EXT4): you add protection against bitrot to any filesystem

2. dm-integrity may be newer, but mdadm and XFS have a large user base, making them well tested.

3. you can test this approach by simulating bitflips on the underlying data device, reading from the /dev/mapper entry, reading files themselves, doing a scrub etc.

4. you can select other algorithms besides crc32: in the rare case the error couldn't be seen by crc32 (which is likely to be applied at the hardware level) you gain an extra layer of safety

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by aforwardslash on Wednesday November 22, 2023 @04:06PM (#38385096)
The level of simplicity of ZFS has no equivalent in Linux; the whole lvm stack is a fuckup from a usability perspective. Half a dozen distinct commands working on different layers that - more often than not - are conceptual. ZFS has been around for almost 20 years now. It was production ready more than 10 years ago, when it was open-sourced. Having your systems 1 or 2 versions behind the mainline is good practice in every mission-critical piece of software.
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by dither8 on Wednesday November 22, 2023 @05:47PM (#38386271)
As someone who just installed OpenZFS on Linux, I agree with you totally.

ZFS just is, no need to worry about layering device mappers and LVM. The automount is also very nice.

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by nortonham on Wednesday November 22, 2023 @11:58PM (#38389469)
I just benefited from ZFS boot environments/snaphsots during the update of FreeBSD from 13.2 to 14.0-release. It's a great tool to have at your disposal
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by csdvrx on Friday November 24, 2023 @02:15PM (#38407157)
> Having your systems 1 or 2 versions behind the mainline is good practice in every mission-critical piece of software.

I do that, and I've even personally experienced a few rare ZFS bugs that seem due to interactions between ZFS and Western Digital firmwares.

Still, I was caught unprepared: I have several backups not stored on ZFS, but all of them were made FROM a ZFS source, meaning they are now all suspicious since silent corruption has been possible since version 2.1.4, and maybe even longer than that.

ZFS is practical to use, but for now I think I'll keep a history of file checksums, like how it was done before bitrot protection.

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by aforwardslash on Friday November 24, 2023 @02:45PM (#38407453)
Still, that could happen with any other FS. Silent corruption is actually quite more common than winning the lottery, so in that regard ZFS is actually a good step on reducing those odds, even if its not zero (like advertised in the package).

I'm also assuming those backups aren't actually ZFS streams (from zfs send|receive) which is a special case of "bugs biting you twice" :P

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by dralley on Wednesday November 22, 2023 @10:39AM (#38380687)
I'd probably give it a release or three (or 5). Still plenty of development actively happening despite it being mostly just Kent.

But yes I plan to use it soon-ish as well.

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by exitheone on Wednesday November 22, 2023 @10:29AM (#38380545)
I had the exact same reaction. Saw the massive list of new features and decided to wait for .1 or .2 releases to shake out the bugs. Seems like patience is paying off as always.
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by tmikaeld on Wednesday November 22, 2023 @10:36AM (#38380639)
Same boat, while they keep shipping impressive features, I've been bitten far too many times on btrfs and zfs.
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by yjftsjthsd-h on Wednesday November 22, 2023 @10:50AM (#38380821)
I've heard and experienced plenty of problems with BTRFS, but it's pretty rare that I hear of problems with ZFS (aside the the current article, obviously); what problems have you hit? (As a very heavy user of ZFS, I would very much like to know about possible problems before they bite me)
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by mastax on Wednesday November 22, 2023 @11:54AM (#38381692)
I have two identical Debian 11 on ZFS servers with ZFS encryption enabled. On one pool on one machine it will start reporting errors after about 1 week of uptime. The errors are caused by failure to decrypt within the Kernel Cryptography Framework. No read/write/cksum errors are reported for any of the zpool devices. Running a scrub finds no errors and clears the errors. The presence of the errors causes my snapshot replication to fail so I need to reboot the server weekly and run a scrub. One person has reported that updating to 2.1.13 fixed the issue, IIRC. That version hasn't been released to Debian 11 yet and that version also included a commit which removed the KCF kstat code so I wouldn't be able to monitor the KCF errors anymore.

Another issue I ran into is when SQLite is run in synchronous mode (the default) with WAL (not default but recommended) and the default locking mode (so it creates an -shm file) and the shm file is stored on a ZFS filesystem. SQLite frequently executes ftruncate on the shm file when different processes access the same SQLite database, and for some reason ZFS can cause the ftruncate call to block until the txg timeout which is usually 5 seconds [0]. If you were running a program which records every shell command you run to a SQLite database, for example, that would cause a 5 second hang before any shell command would execute [1]. The workaround is to disable synchronous in SQLite or the ZFS dataset, which is probably safe because of the ZFS atomicity guarantees.

Those are two examples I have run into recently. I'm sure people run into issues with e.g. ext4 as well but I think they are a bit more frequent with ZFS on Linux, especially if you use more fringe features like encryption.

[0]: https://github.com/openzfs/zfs/issues/14290

[1]: https://github.com/atuinsh/atuin/issues/952

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by ryao on Wednesday November 22, 2023 @12:16PM (#38381978)
Unfortunately, encryption never was quite as robust as the rest of ZFS. That said, things have become much better in the past year, as there have been targetted efforts focused on improving it, which found and fixed multiple bugs.

That said, most of the developers are likely not using it on their own systems, which probably allowed bugs to stick around abnormally long compared to the rest of the code base (although some really ancient bugs were found last year in other areas).

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by antongribok on Wednesday November 22, 2023 @12:22PM (#38382074)
Here's an example of a nasty data corruption bug in ZFS from not that long ago: https://github.com/openzfs/zfs/issues/7401

Corresponding HN discussion at the time: https://news.ycombinator.com/item?id=16797644

Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by ryao on Wednesday November 22, 2023 @01:02PM (#38382667)
That was 5 years ago. What would you consider to be a long time ago?
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by viraptor on Wednesday November 22, 2023 @02:12PM (#38383700)
You can find many corruption issues on the openzfs bug tracker. The btrfs corruptions are a bit of a meme now and everyone has their own story from (old system, unsupported feature) failure long time ago, so it's quite hard to really compare how stable they are in realistic scenarios.
Re:ZFS 2.2.1: Block Cloning disabled due to data corruption by tmikaeld on Thursday November 23, 2023 @10:12AM (#38393555)
Since you asked me, it was many years ago now (5+) - but it hurt. I lost a 16TB cluster to btrfs, the raid just failed for no apparent reason (this wasn't uncommon back then according to forums). And on ZFS it was a kernel bug where on boot, it would mount ZFS after waiting for root - so root never appeared. (This was due to ZFS running as a user-space driver on linux back when it wasn't yet in the kernel)