mirror of https://github.com/schoebel/mars
marsadm: detect orphan logfile sizes
This commit is contained in:
parent
31a1575182
commit
5bd288b4be
|
@ -4070,12 +4070,21 @@ sub eval_fn {
|
||||||
my $peer = parse_macro($arg1, $env);
|
my $peer = parse_macro($arg1, $env);
|
||||||
$peer = $$env{"host"} unless $peer;
|
$peer = $$env{"host"} unless $peer;
|
||||||
my $replay = get_link($$env{"resdir"} . "/replay-$peer", 1);
|
my $replay = get_link($$env{"resdir"} . "/replay-$peer", 1);
|
||||||
$replay =~ m/^(log-[^,]+),/;
|
$replay =~ m/^(log-[^,]+),([0-9]*)/;
|
||||||
my $logfile = $$env{"resdir"} . "/" . $1;
|
my $logfile = $$env{"resdir"} . "/" . $1;
|
||||||
if (-r $logfile) {
|
my $logpos = $2;
|
||||||
return 0;
|
if (! -r $logfile) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return 1;
|
my @stat = stat($logfile);
|
||||||
|
if (!@stat) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
my $size= $stat[7];
|
||||||
|
if ($size < $logpos) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
if (/^is[-_]?(almost[-_]?)?consistent$/) {
|
if (/^is[-_]?(almost[-_]?)?consistent$/) {
|
||||||
my $almost = $1;
|
my $almost = $1;
|
||||||
|
|
Loading…
Reference in New Issue