mirror of
https://github.com/schoebel/mars
synced 2024-12-15 03:05:12 +00:00
marsadm: allow switchback to primary when I am actually primary
For example, when /dev/mars/something is mounted or in another use, switching to secondary will only succeed after the device has been closed. During this intermediate state, we allow to switch back to primary without checking all the big checks.
This commit is contained in:
parent
6de8dc9639
commit
5fc1844eba
@ -807,6 +807,10 @@ sub primary_res {
|
||||
exit(0);
|
||||
} elsif($force) {
|
||||
lprint "FORCING myself ($host) to primary...\n";
|
||||
} elsif (! -d "/proc/sys/mars") {
|
||||
ldie "cannot switch to primary: mars kernel module is not loaded\n";
|
||||
} elsif (readlink("$mars/resource-$res/actual-$host/is-primary")) {
|
||||
lwarn "I am actually primary: skipping check to set me back.\n";
|
||||
} else { # try to switch myself to primary
|
||||
lprint "trying to switch $host to primary...\n";
|
||||
check_sync_finished($res, $host);
|
||||
|
Loading…
Reference in New Issue
Block a user