mirror of https://github.com/schoebel/mars
marsadm: fix split brain detection
This commit is contained in:
parent
1715b4fd40
commit
a43181a84f
|
@ -657,6 +657,23 @@ sub detect_splitbrain {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ($ok) { # check for duplicate logfiles
|
||||
my @logs = glob("$mars/resource-$res/log-*");
|
||||
my $oldnr = -1;
|
||||
foreach my $path (sort(@logs)) {
|
||||
$path =~ m:/log-([0-9]+):;
|
||||
my $nr = $1;
|
||||
if ($nr == $oldnr) {
|
||||
$ok = 0;
|
||||
lwarn "SPLIT BRAIN at '$res' detected: duplicate logfile number $nr\n";
|
||||
lwarn "hint: first resolve split brain by 'leave-resource' or 'invalidate'\n";
|
||||
lwarn "hint: if this does not help, try cleanup via 'log-purge-all'\n";
|
||||
lwarn "hint: if this does not help, try 'log-purge-all --force'\n";
|
||||
last;
|
||||
}
|
||||
$oldnr = $nr;
|
||||
}
|
||||
}
|
||||
$detected_splits{$res} = $ok;
|
||||
return $ok;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue