marsadm: workaround race between create-resource and join-resource

This commit is contained in:
Thomas Schoebel-Theuer 2013-06-03 13:51:56 +02:00
parent dab34fa2f6
commit e7edf0020e
1 changed files with 6 additions and 1 deletions

View File

@ -679,7 +679,12 @@ sub _set_replaylink {
$old_primary = $1 if $vers_val =~ m/:.*,log-[0-9]+-([^,]+),/;
_fake_versionlink($basedir, $log_nr - 1, $old_primary);
} else {
my $initial = get_link("$basedir/version-000000001-$primary");
my $initial;
for (;;) {
$initial = get_link("$basedir/version-000000001-$primary", 1);
last if $initial;
sleep_timeout();
}
set_link($initial, "$basedir/version-000000001-$host");
}
}