Closed jimklimov closed 1 year ago
So, somehow this bit misfires:
# lib/ZnapZend.pm
createSnapshot = { ...
$self->zZfs->destroySnapshots(@dataSetsExplicitlyDisabled, 0);
# lib/ZnapZend/ZFS.pm
sub destroySnapshots {
my @toDestroy = ref($_[0]) eq "ARRAY" ? @{$_[0]} : ($_[0]);
my @recursive = $_[1] ? ('-r') : ();
...
Actually the $_
contains a long array with each item from original dataSetsExplicitlyDisabled
, and then the recursion option as a cherry on top.
I was among last to touch this code in 0bdfece7 actually, but built upon earlier existing spelling with @
-varname. Other usages of the method pass a dollar-varname like:
$self->zZfs->destroySnapshots($toDestroy, 1);
Yep, that was it - REFERENCE to array \@
did it. Now there's some bug inside the destroy method :)
[2022-10-22 15:56:26.30814] [13253] [info] Requesting removal of marked datasets: rpool/export/home/abuild/.ccache@znapzend-auto-2022-10-22T15:56:25Z, rpool/export/home/abuild/jenkins-nut@znapzend-auto-2022-10-22T15:56:25Z, rpool/export/home/abuild/jenkins-nut-doc@znapzend-auto-2022-10-22T15:56:25Z
# zfs destroy rpool/export/home/abuild/.ccache@znapzend-auto-2022-10-22T15:56:25Z,znapzend-auto-2022-10-22T15:56:25Z,znapzend-auto-2022-10-22T15:56:25Z
Above in non-oracleMode it passes comma-separated list of snapshot names for one dataset, but not different datasets.
ok, so gotta map all snaps for each dataset, then glue stuff together
Support for disabling snapshots of certain children goes as recursive snapshot of the parent and removal of these snaps for certain child datasets. In practice I see however only the first one cleaned up this way (both in
oracleMode
and without):and that's it - the only
destroy
in that run's log.