From 6559c534be54a2988d4c379c8f188e9714aeab44 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 14 Mar 2016 07:49:12 +0100 Subject: [PATCH] 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. --- userspace/marsadm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/userspace/marsadm b/userspace/marsadm index e944e9a0..883939d2 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -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);