-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zfs send/recv compressed streams from ubuntu 22.04 to ubuntu 20.04 may corrupt your files #14188
Comments
Wow. This is a very nice report. I cannot look at it immediately, but it is on my radar now. Thanks. :) |
I have a follow up. |
This reminds me of #12762. It seems like we are sometimes emitting blocks with compression type 0 and actually compressed contents - at least, that's my quick interpretation of this diff segment between Now, the two interesting questions are:
|
I checked ashift, the 20.04 server is explicitly set to 12, the 22.04 ubuntu is 0, but I guess this defaults to 12. |
Interesting. So, 0 just means "whatever we autodetect the disks to", not necessarily 12, but I think the send stream is wrong anyway before it ever cares about the receiver if it's reporting uncompressed blocks. Could you quickly double check the output of "zfs version" for me, both lines? Because this really seems like what should have been resolved by #12762's fix, but is also, according to your report, a version after when that should be in... |
Thanks, so the version of Ubuntu 20.04 is 0.8.3-1ubuntu12.14 like I have written on top. It's the default zfs from Ubuntu 20.04 together with the default Ubuntu Linux kernel. |
The workstation originating the faulty zfs stream is indeed formatted as 512 bit block size and the receiving 20.04 server has ashift 2^12 thus 4096 |
I meant for the sender and receiver, since the fix should be on the sender side, but that version should be new enough to have it, in theory. ...in theory because Ubuntu has a bad habit of shipping mixed kernel and userland versions. edit: ...wait, what the crap? According to that zdb output, it stored the file compressed...with the same logical/physical size, which would explain the check failing, but raises further questions...especially when the DVA says it's 0x3000 and PSIZE is 0x400. |
Could you share the output of e: I made a reproducer. For anyone following along at home, go write something to a single disk vdev pool that compresses with lz4, then do send -c | recv into a draid pool. You wind up with things like:
And then boom goes the dynamite when you do send again. |
The |
I can reproduce it, yes, but I'm confused how you ended up with that zdb output on a pool with a single disk, as I ended up using a draid vdev for it... |
Sorry for the confusion, but the |
Could you do it on the 22.04 server? I think I know what I'll find now, but just to be sure. I'm also not sure if this is an accurate reproduction right now, so we'll see, but I think that's what's happening, is that it's getting confused by the size not being different and marking them uncompressed in the send stream. |
This is on the Ubuntu 22.04 workstation:
|
ok, I messed up I guess, so I redid the send/recv on the Ubuntu 20.04 machine:
and then the tank/error:
the |
If I redo the |
Oh, I see, I misunderstood, I thought those send streams came from the 22.04 box. This really is just #12762. Go nag Ubuntu to cherrypick the patch or run a version that's not from 2020. |
Well, yes. The tank/test stream comes from an Ubuntu 22.04, it is once received on the Ubuntu 20.04 that it gets corrupted when it has to resend to a secondary backup server (or it's own). |
AFAIK 0.8.x isn't getting another release in...ever, so I don't think it's likely that the fix will be backported into something useful here. If Ubuntu wants to support it, they can backport it, I don't think the change is that disruptive, but the reason I didn't just open with that is I misunderstood that those streams were the ones sent from 22.04 to 20.04, not what 20.04 produced afterward of it. My apologies for the confusion and running around. I would seriously suggest opening a Launchpad bug against 20.04 linking to this thread and #12762 and asking them to cherrypick it since it's easy to reproduce mangling your data with it. |
System information
Describe the problem you're observing
I was doing backups from the newer Ubuntu 22.04 OS to our backup server, but this one is still at Ubuntu 20.04.
When I looked at some files, some of them got corrupted. I checked everything, scrub, network, ram memory to make sure it is not hardware related.
Describe how to reproduce the problem
At the moment I can only reproduce it on my ubuntu 20.04 machine. This is what I do. The zpool is called
tank
. I have made the backup as such:The file contains a file demo/index.json, if I open it, I can see the json in text.
Now I copy it on the local disk (or a remote server gives the same effect):
I open the file in demo/index.json, I see a garbage file. Now without compression:
open the file in
/tank/test3
, I find the normal file.The problem is not all files in the backup stream get corrupted. I isolated a file and put it in a
test.zip
The zip file contains 2 zfs streams which I got on the ubuntu 20.04 backup:
Suggestion
The suggestion is to use zfs send/recv without -c, or update the backup server to Ubuntu 22.04, this also fixed the bug, but I'm not 100% sure if older zfs clients will mess up to the newer zfs version? Any thoughts?
Include any warning/errors/backtraces from the system logs
No warnings
The text was updated successfully, but these errors were encountered: