mirror of
https://github.com/schoebel/mars
synced 2024-12-29 02:12:53 +00:00
marsadm: fix too strong race detection
This commit is contained in:
parent
beea145ec4
commit
94df66a3c1
@ -3061,9 +3061,10 @@ sub log_purge_res {
|
||||
my $replay = "$basedir/replay-$peer";
|
||||
my $target = get_link($replay, 1);
|
||||
next unless $target;
|
||||
$situation{$replay} = $target;
|
||||
lprint "found replay link '$replay' -> '$target'\n";
|
||||
# only the logfile number is relevant, not the positions
|
||||
$target =~ s/,.*//;
|
||||
$situation{$replay} = $target;
|
||||
$start_logs{$target}++;
|
||||
$start_count++;
|
||||
_mark_path_transitive($basedir, $target, $peer);
|
||||
@ -3127,6 +3128,8 @@ sub log_purge_res {
|
||||
foreach my $replay (sort keys(%situation)) {
|
||||
my $old_situation = $situation{$replay};
|
||||
my $target = get_link($replay, 1);
|
||||
# only the logfile number is relevant, not the positions
|
||||
$target =~ s/,.*//;
|
||||
if (!$target || $target ne $old_situation) {
|
||||
lwarn "Race on '$replay' -> '$target' instead of '$old_situation'\n";
|
||||
$nr_races++;
|
||||
@ -3135,6 +3138,7 @@ sub log_purge_res {
|
||||
if ($nr_races) {
|
||||
if ($max_retry-- > 0) {
|
||||
lwarn "Restarting due to $nr_races races\n";
|
||||
sleep(1);
|
||||
goto retry;
|
||||
}
|
||||
ldie "Detected $nr_races, the situation is not stable\n";
|
||||
|
Loading…
Reference in New Issue
Block a user