mirror of https://github.com/schoebel/mars
marsadm: remove all version links at leave-resource
This commit is contained in:
parent
860ec8d37a
commit
a3c429fdd1
|
@ -1047,7 +1047,6 @@ sub leave_res_phase1 {
|
|||
}
|
||||
_create_delete($dir);
|
||||
}
|
||||
cleanup_res($cmd, $res, 0);
|
||||
finish_links();
|
||||
}
|
||||
|
||||
|
@ -1055,6 +1054,7 @@ sub leave_res_phase1 {
|
|||
sub leave_res_phase2 {
|
||||
my ($cmd, $res) = @_;
|
||||
_wait_delete();
|
||||
log_purge_res(@_);
|
||||
}
|
||||
|
||||
sub logrotate_res {
|
||||
|
@ -1415,24 +1415,6 @@ sub wait_umount_res {
|
|||
lprint "OK, device for resource '$res' is not in use.\n";
|
||||
}
|
||||
|
||||
sub cleanup_res {
|
||||
my ($cmd, $res, $replay_nr) = @_;
|
||||
my @logfiles = glob("$mars/resource-$res/log-*-$host");
|
||||
my @versions = glob("$mars/resource-$res/version-*-$host");
|
||||
foreach my $path (@logfiles) {
|
||||
$path =~ m:/log-([0-9]+)-: or next;
|
||||
my $nr = $1;
|
||||
next if $nr >= $replay_nr;
|
||||
_create_delete($path);
|
||||
}
|
||||
foreach my $path (@logfiles, @versions) {
|
||||
$path =~ m:/version-([0-9]+)-: or next;
|
||||
my $nr = $1;
|
||||
next if $nr >= $replay_nr - 1;
|
||||
_create_delete($path);
|
||||
}
|
||||
}
|
||||
|
||||
sub invalidate_res_phase0 {
|
||||
my ($cmd, $res) = @_;
|
||||
check_not_primary(@_);
|
||||
|
|
Loading…
Reference in New Issue