-
Notifications
You must be signed in to change notification settings - Fork 136
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
Allow configuring mbuffer
path and size separately for each destination (and source) system
#630
Conversation
Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Hm, it did honour the destination settings but did not add a sender mbuffer. Checking... |
…ource and destinations [oetiker#629] Signed-off-by: Jim Klimov <jimklimov@gmail.com>
A few typo fixes and a force-push later, the test with local settings passes (uses
|
Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Signed-off-by: Jim Klimov <jimklimov@gmail.com>
…tiker#629] Signed-off-by: Jim Klimov <jimklimov@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oetiker : got a late-arriving question, posted with code context.
$self->zfs->fileExistsAndExec($file) | ||
or warn "*** WARNING: executable '$mbuffer' does not exist" . ($remote ? " on $remote\n\n" : "\n\n"); | ||
or warn "*** WARNING: executable '$mbuffer' does not exist on " . ($remote ? "remote $remote" : "local") . " system, zfs receive can fail\n\n"; | ||
# TOTHINK: Reset to 'off'/undef and ignore the validity checks below? | ||
|
||
#check if mbuffer size is valid | ||
$backupSet->{mbuffer_size} =~ /^\d+[bkMG%]?$/ | ||
or die "ERROR: mbuffer size '" . $backupSet->{mbuffer_size} . "' invalid\n"; | ||
$backupSet->{$dst . '_mbuffer_size'} =~ /^\d+[bkMG%]?$/ | ||
or die "ERROR: mbuffer size '" . $backupSet->{$dst . '_mbuffer_size'} . "' invalid\n"; | ||
#check if port is numeric | ||
$mbufferPort && do { | ||
$mbufferPort =~ /^\d{1,5}$/ && int($mbufferPort) < 65535 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oetiker : WDYT about the TOTHINK comment here?
If we checked and could not confirm the mbuffer
presence on remote destination, should we still try piping through it on receiver? Maybe there's a miracle like some shell alias or profile function to take care of it... we did warn about possible broken sending.
The alternative is - if we could not confirm its presence, set to undef
or off
here, and avoid using it at all. So SSH pipes right into zfs recv
, maybe sub-optimally, but reliably. On the downside, the user never gets a nudge to actually fix their setup and optimize the transfer with buffering.
Now that I think of it, znapzendzetup list
probably uses these methods (it does try to go to remote and confirm stuff), so resetting the values (perhaps for src_mbuffer
above also) may be not a very good idea for visibility of on-disk setup; it does however represent the currently active setup (what would be executed if we run this right now).
So, I have a simmering concern but no particular opinion about what is "right" here, at the moment. Any inputs? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with things like this I am a fan of the software not trying to guess and hoping for a lucky strike
if there is no mbuffer at the remote end as promissed, things should fail ... clear and simple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that src_mbuffer=undef
is seen if you search for it e.g. in config printout (not practically an issue -- is handled in sendRecvSnapshots()
as off
):
[2024-01-17 13:28:43.93473] [1538179] [info] WARNING: property 'src_mbuffer_size' not set on backup for rpool/ROOT, inheriting from legacy 'mbuffer_size': 128M
[2024-01-17 13:28:44.23728] [1538179] [info] WARNING: property 'dst_0_mbuffer' not set on backup for rpool/ROOT, inheriting path[:port] from legacy 'mbuffer': mbuffer
[2024-01-17 13:28:44.23749] [1538179] [info] WARNING: property 'dst_0_mbuffer_size' not set on backup for rpool/ROOT, inheriting from legacy 'mbuffer_size': 128M
...
*** backup plan: rpool/ROOT ***
dst_0 = znapzend:pond/export/DUMP/NUTCI/znapzend/ci-deb/rpool/ROOT
dst_0_mbuffer = mbuffer
dst_0_mbuffer_size = 128M
dst_0_plan = 1month=>1week,1year=>1month,10years=>6months
enabled = on
mbuffer = mbuffer
mbuffer_size = 128M
post_znap_cmd = off
pre_znap_cmd = off
recursive = on
src = rpool/ROOT
Use of uninitialized value in printf at /usr/bin/znapzendzetup line 36.
src_mbuffer =
src_mbuffer_size = 128M
src_plan = 1month=>1week,1year=>1month,10years=>6months
tsformat = znapzend-auto-%Y-%m-%dT%H:%M:%SZ
zend_delay = 0
Note how dst_0_mbuffer
is not defined in the properties and gets inherited from legacy mbuffer
-- maybe the right thing for src_mbuffer
is to fall it back as off
instead of undef
after all (unless in "networked mbuffer" mode)?
# zfs get -s local all rpool/ROOT | sort | grep znap
rpool/ROOT org.znapzend:dst_0 znapzend:pond/export/DUMP/NUTCI/znapzend/ci-deb/rpool/ROOT local
rpool/ROOT org.znapzend:dst_0_plan 1months=>1weeks,1years=>1months,10years=>6months local
rpool/ROOT org.znapzend:enabled on local
rpool/ROOT org.znapzend:mbuffer mbuffer local
rpool/ROOT org.znapzend:mbuffer_size 128M local
rpool/ROOT org.znapzend:post_znap_cmd off local
rpool/ROOT org.znapzend:pre_znap_cmd off local
rpool/ROOT org.znapzend:recursive on local
rpool/ROOT org.znapzend:src_plan 1months=>1weeks,1years=>1months,10years=>6months local
rpool/ROOT org.znapzend:tsformat znapzend-auto-%Y-%m-%dT%H:%M:%SZ local
rpool/ROOT org.znapzend:zend_delay 0 local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nice:
*** WARNING: executable 'off' does not exist on source system, will ignore
...
Use of uninitialized value in printf at /usr/bin/znapzendzetup line 36.
src_mbuffer =
Oh the edge cases :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted a couple of fixes as #632
Closes: #629
See rationale and investigation details in the linked issue above.
Practical run with legacy-only setup (and debug mode):
And for a setup with dedicated values: