Skip to content

Commit

Permalink
Handle not-sending of not-enabled datasets (#626)
Browse files Browse the repository at this point in the history
* lib/ZnapZend.pm: createSnapshot(): be pedantic about "implicit value of org.znapzend:enabled" for sub-datasets

Signed-off-by: Jim Klimov <[email protected]>

* lib/ZnapZend.pm: createSnapshot(): update comments about creation and cleanup of snapshots on enabled=off sub-datasets

Signed-off-by: Jim Klimov <[email protected]>

* lib/ZnapZend.pm: refactor listDisabledSourceDescendants() out of createSnapshot() so it can also be used in sendRecvCleanup()

Signed-off-by: Jim Klimov <[email protected]>

* lib/ZnapZend.pm: refactor listDisabledSourceDescendants() calls to be done in refreshBackupPlans() once

Track the list of names as @{$backupSet->{srcDisabledDescendants}}

Signed-off-by: Jim Klimov <[email protected]>

* lib/ZnapZend.pm: sendRecvCleanup(): skip sending of disabled datasets

Signed-off-by: Jim Klimov <[email protected]>

* lib/ZnapZend.pm: sendRecvCleanup(): clarify the message when we skip a not-enabled dataset

Signed-off-by: Jim Klimov <[email protected]>

* lib/ZnapZend.pm: sendRecvCleanup(): wrap the long source code line to emit a debug message about sending (or not) a dataset

Signed-off-by: Jim Klimov <[email protected]>

---------

Signed-off-by: Jim Klimov <[email protected]>
Co-authored-by: Tobias Oetiker <[email protected]>
  • Loading branch information
jimklimov and oetiker authored Mar 12, 2024
1 parent e690f41 commit aa0bfed
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/ZnapZend.pm
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,14 @@ my $sendRecvCleanup = sub {
my $dstDataSet = $srcDataSet;
$dstDataSet =~ s/^\Q$backupSet->{src}\E/$backupSet->{$dst}/;

$self->zLog->debug('sending snapshots from ' . $srcDataSet . ' to ' . $dstDataSet . ((grep (/^\Q$srcDataSet\E$/, @dataSetsExplicitlyDisabled)) ? ": not enabled, should be skipped" : ""));
{
my $srcDataSetDisabled = (grep (/^\Q$srcDataSet\E$/, @dataSetsExplicitlyDisabled));
$self->zLog->debug('sending snapshots from ' . $srcDataSet . ' to ' . $dstDataSet .
($srcDataSetDisabled ? ": not enabled, skipped" : ""));
if ($srcDataSetDisabled) {
next;
}

{ # scoping
local $@;
eval {
local $SIG{__DIE__};
Expand Down

0 comments on commit aa0bfed

Please sign in to comment.