-
Notifications
You must be signed in to change notification settings - Fork 139
autoCreation broken in 0.22.0. #650
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
Comments
@jimklimov does this ring a bell ? |
@stuckj thank you for the report. If you could add to our test suite we could make sure this remains fixed |
No, sorry - did not misbehave like that for me :\ Maybe I tried with somewhat different use-cases. Will try to investigate in the coming days |
Do you mean add it as a perl test? I can take a stab at that. If I'm understanding the current test design, it looks like all of the external tools are mocked out to store env vars based on how they're called. And then the tests just verify that the tools were called with the expected parameters, right? I can figure out how the working instances from 0.21.2 were working vs 0.22.0 and see if I can modify the tests to handle the case. I'll try to find some evening time to work on it (always a challenge with work and kids, but I'll give it a go). |
yes exactly, the tests mock everyting so the mocks may require enhancement |
So, dug a bit more into this. About the Regarding the main issue, in
Then we get into the "sending loop through all subdatasets", where we also juggle (another evaluation of) At least, in this block:
changing
... does help the test script succeed:
Gotta sit closely and rectify when and how we want the impact from @oetiker : IIRC it is about encrypted datasets; do we want those always sent (effectively auto-created by virtue of being encrypted)? |
Looking at history in
The latter entry should have been about my recent efforts in the area; earlier ones come IIRC from different authors. |
I guess in this clause, we have no impact from sendRaw being set or not. If not told to auto-create and destination does not exist - skip. Right? Or maybe not. If autocreating, but also a dataset is sendRaw, still avoid creating it (per third changelog line above). |
…working or slacking off, and do not rely on existence of the property to set it [oetiker#650] Addresses the part of issue oetiker#650 where ./bin/znapzendzetup enable-dst-autocreation --debug test1 nas in fact did nothing. Signed-off-by: Jim Klimov <[email protected]>
…ilteredAway in the log, to avoid confusion [oetiker#650] Signed-off-by: Jim Klimov <[email protected]>
…n condition clause when a destination sub-dataset is missing [oetiker#650] Signed-off-by: Jim Klimov <[email protected]>
…working or slacking off, and do not rely on existence of the property to set it [oetiker#650] Addresses the part of issue oetiker#650 where ./bin/znapzendzetup enable-dst-autocreation --debug test1 nas in fact did nothing. Signed-off-by: Jim Klimov <[email protected]>
…ilteredAway in the log, to avoid confusion [oetiker#650] Signed-off-by: Jim Klimov <[email protected]>
…n condition clause when a destination sub-dataset is missing [oetiker#650] Signed-off-by: Jim Klimov <[email protected]>
PR #657 posted. And I tender my apologies about probably botching this up in the first place :\ |
By the way, @stuckj : would you mind posting a PR to add your repro script into https://github.com/oetiker/znapzend/tree/master/contrib - even "as is" it can be a helpful foundation for developer testing iterations. Did help me while fixing the issue :) |
@jimklimov, absolutely. Here's the PR: #658. Sorry, I have not had a chance to integrate this into the test suite. We have end of school year madness with my kids right now along with sickness with the same kids. Looks like winter-time bugs are running into summer this year. :-P |
Hmmm, I'm a bit confused. It seems that after this change, it's no longer possible for znapzend to send the first (initial) snapshot backup to remote, as the remote dataset doesn't exist yet, and znapzend has now decided not to create it automatically. But it also won't work if I simply create a dataset on the remote, as that'd be an unencrypted dataset. So.. what's the recommended way of setting up an encrypted backup destination? With some manual send/recv at first? Not a zfs expert, so I'd appreciate any help. |
have you tried starting with the |
@oetiker I suppose you mean |
I think the recent posts are growing to be a separate (though related) issue about auto-creation behavior of encrypted destination datasets. This one was originally about something else, resolved and closed (perhaps popping up a pain point elsewhere). Anyhow, #650 (comment) listed some "prior art" in earlier discussions. My understanding at the moment is that different implementations of ZFS across its two decades and many OSes and teams working on it could at least disagree about receiving or not the initial encrypted snapshot as a raw one, maybe depending also on some circumstances of the receiving pool or parent dataset. Apparently something worked before, at least in your src/dst combo, and does not now, so it is a regression, violation of least-surprise principle in development, etc. What I currently worry about is if there is a single fix that fits all cases, or yet another feature or CLI option or dst-based property is needed to tweak it for different src/dst combos? |
Uh oh!
There was an error while loading. Please reload this page.
Howdie,
I've been using znapzend for several years. Thanks BTW, it's been a big help!
TL;DR:
enable-dst-autocreation
command forznapzendzetup
is also broken UNLESS the autocreation property already exists on the dataset.Details:
While setting up a new desktop I noticed that the latest version from git (and 0.22.0) appears to have broken autoCreation. Specifically, if you have a simple setup with a recursive backup definition at the root and propagated to all sub-datasets, the initial backup to a destination will not auto-create those sub-datasets. Also, if you make new datasets in the source they won't get sent to the destination.
Furthermore, the new
enable-dst-autocreation
feature onznapzendzetup
only works if the autocreation property already exists on the dataset. It won't set te property if it's not there already.My laptop has 0.21.1 installed and it properly auto-creates sub-dataset to my server. The new desktop is running proxmox and I'm using my znapzend docker wrapper for proxmox (https://hub.docker.com/r/stuckj/znapzend-proxmox) which currently uses the latest from git (going to change that to 0.21.2 since discovering this). That's how I noticed the discrepancy since it works fine on my laptop, but not on the new desktop.
I made a super-simple script to demonstrate the problem (autocreate-test.sh.gz). You must run it as root since it creates test pools (and destroys them first). Do look it over before running it just in case you have existing pools named
test1
ortest2
. :-PRunning that script on 0.21.1 or 0.21.2 successfully replicates the pool structure between
test1
->test2
. On 0.22.0+ (checked out directly and built locally) it fails to create the sub-datasets. Only the root dataset is replicated.I noticed in the diff that there were changes adding in
autoCreation
zfs properties for the destination. I tried setting those withznapzendzetup enable-dst-autocreation test1 nas
, but it did nothing. This appears to be a separate bug. So, I MANUALLY set the property (based on what the code looked like it wanted) withzfs set org.znapzend:dst_nas_autocreation=on test1
. That still doesn't work though...same error about the sub-destination not existing.Below are the log outputs to versions 0.21.1, 0.21.2, 0.22.0, and the latest in git. It only works properly in versions 0.21.1 and 0.21.2 and appears to have broken in version 0.22.0.
Log Output
0.21.1 output: autocreate-results-0.21.1.log
0.21.2 output: autocreate-results-0.21.2.log
0.22.0 output: autocreate-results-0.22.0.log
git latest output: autocreate-results-latest.log
Test Script
The text was updated successfully, but these errors were encountered: