mirror of
https://github.com/schoebel/mars
synced 2025-02-08 08:07:26 +00:00
marsadm: guard leave-resource against complicated races
This commit is contained in:
parent
3fbf2c2aaf
commit
88d7456c79
@ -5802,6 +5802,12 @@ my $old_nr_replicas = 0;
|
||||
|
||||
sub leave_res_phase0 {
|
||||
my ($cmd, $res) = @_;
|
||||
# guard against complicated distributed races
|
||||
my $nr_replicas = get_nr_replicas(@_);
|
||||
if ($nr_replicas > 2) {
|
||||
update_cluster($cmd, $res);
|
||||
}
|
||||
# check preconditions
|
||||
check_not_primary($cmd, $res, 1);
|
||||
my $errors = 0;
|
||||
foreach my $tmp (lamport_glob("$mars/resource-$res/todo-$host/*")) {
|
||||
|
Loading…
Reference in New Issue
Block a user