marsadm: directly switch back to former primary

Use the new knowledge about old primary.

This is only relevant for people who are consistently ignoring
mars-manual.pdf which clearly states that intermediate
"marsadm secondary" should not be used at all, except for the
last step in final destruction of a resource.
This commit is contained in:
Thomas Schoebel-Theuer 2016-03-14 07:49:12 +01:00
parent 79a1d20c69
commit 6559c534be
1 changed files with 4 additions and 0 deletions

View File

@ -1151,6 +1151,10 @@ sub try_to_avoid_splitbrain {
}
}
}
if ($primary && $primary eq $host) {
lprint "Switching back to last primary.\n";
last;
}
# if the old primary is known, we can ignore all other / unrelated hosts
if ($primary && $primary ne $host && $primary ne "(none)") {
my $p_path = sprintf("$mars/resource-$res/version-%09d-%s", $max, $primary);