mirror of
https://github.com/schoebel/mars
synced 2025-01-14 02:50:48 +00:00
marsadm: fix race between fetch and primary --force
This commit is contained in:
parent
de036d0b52
commit
c3e5df459f
@ -3941,6 +3941,13 @@ sub primary_phase0 {
|
||||
lprint "all preconditions OK for resource '$res'\n";
|
||||
}
|
||||
|
||||
# only for primary --force: wait until fetch has actually stopped
|
||||
sub primary_phase0a {
|
||||
my ($cmd, $res) = @_;
|
||||
return unless $force;
|
||||
wait_cond($cmd, $res, "is-fetch-off");
|
||||
}
|
||||
|
||||
# only for systemd: wait that primary device is no longer open
|
||||
sub primary_phase0b {
|
||||
my ($cmd, $res) = @_;
|
||||
@ -6762,6 +6769,8 @@ my %cmd_table =
|
||||
\&primary_phase0,
|
||||
"check preconditions",
|
||||
"FORK",
|
||||
\&primary_phase0a,
|
||||
"conditionally wait for fetch off",
|
||||
\&primary_phase0b,
|
||||
"wait for systemd",
|
||||
\&primary_phase1,
|
||||
|
Loading…
Reference in New Issue
Block a user