btrbk: bugfix: do not keep latest common snapshot for "incremental no"

There is no reason to keep the latest common source snapshot if
"incremental no" is configured (see #252).
pull/208/merge
Axel Burri 2018-10-02 17:22:57 +02:00
parent 1862bc16d3
commit 3528927ea6
2 changed files with 14 additions and 10 deletions

View File

@ -11,6 +11,8 @@ btrbk-0.27.0-dev
* Bugfix: add "btrfs filesystem usage" backend mapping (close #222). * Bugfix: add "btrfs filesystem usage" backend mapping (close #222).
* Bugfix: do not fail (exitcode=10) if targets are not accessible on * Bugfix: do not fail (exitcode=10) if targets are not accessible on
"btrfs snapshot --preserve". "btrfs snapshot --preserve".
* Bugfix: if "incremental no" is configured on target, do not keep
latest common snapshot.
* Enhance internal data structures: * Enhance internal data structures:
- Allow snapshot_dir to be a mountpoint. - Allow snapshot_dir to be a mountpoint.
- Search complete target tree for correlated subvolumes. - Search complete target tree for correlated subvolumes.

22
btrbk
View File

@ -5990,17 +5990,19 @@ MAIN:
next; next;
} }
# always preserve latest common snapshot/backup pair # preserve latest common snapshot/backup (for incremental targets)
foreach my $child (@snapshot_children) { if(config_key($droot, "incremental")) {
my @receive_targets = get_receive_targets($droot, $child, exact => 1); foreach my $child (@snapshot_children) {
if(scalar(@receive_targets)) { my @receive_targets = get_receive_targets($droot, $child, exact => 1);
DEBUG "Force preserve for latest common snapshot: $child->{PRINT}"; if(scalar(@receive_targets)) {
$child->{node}{FORCE_PRESERVE} = 'preserve forced: latest common snapshot'; DEBUG "Force preserve for latest common snapshot: $child->{PRINT}";
foreach(@receive_targets) { $child->{node}{FORCE_PRESERVE} = 'preserve forced: latest common snapshot';
DEBUG "Force preserve for latest common target: $_->{PRINT}"; foreach(@receive_targets) {
$_->{node}{FORCE_PRESERVE} = 'preserve forced: latest common target'; DEBUG "Force preserve for latest common target: $_->{PRINT}";
$_->{node}{FORCE_PRESERVE} = 'preserve forced: latest common target';
}
last;
} }
last;
} }
} }