marsadm: keep informational versionlinks during split-brain

This commit is contained in:
Thomas Schoebel-Theuer 2017-12-13 11:47:30 +01:00 committed by Thomas Schoebel-Theuer
parent b4ea846e1d
commit fde0e56e98
1 changed files with 8 additions and 1 deletions

View File

@ -2509,8 +2509,15 @@ sub logdelete_res {
_create_delete($first);
}
my @versionlinks = glob("$mars/resource-$res/version-*");
# dont remove versionlinks during split-brain as long as possible
if (scalar(@versionlinks) < $max_deletions / 8 &&
!detect_splitbrain($res, 1)) {
lwarn "SPLIT BRAIN: keep some versionlinks for better reporting\n";
return unless $force;
}
lprint "removing left-over version symlinks...\n" if $verbose;
foreach my $versionlink (glob("$mars/resource-$res/version-*")) {
foreach my $versionlink (@versionlinks) {
my $nrv = $versionlink;
$nrv =~ s/^.*\/version-([0-9]+)-.+$/$1/;
# we need at least one more version link than logfiles for consistency checks