mirror of https://github.com/schoebel/mars
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";
|
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
|
# only for systemd: wait that primary device is no longer open
|
||||||
sub primary_phase0b {
|
sub primary_phase0b {
|
||||||
my ($cmd, $res) = @_;
|
my ($cmd, $res) = @_;
|
||||||
|
@ -6762,6 +6769,8 @@ my %cmd_table =
|
||||||
\&primary_phase0,
|
\&primary_phase0,
|
||||||
"check preconditions",
|
"check preconditions",
|
||||||
"FORK",
|
"FORK",
|
||||||
|
\&primary_phase0a,
|
||||||
|
"conditionally wait for fetch off",
|
||||||
\&primary_phase0b,
|
\&primary_phase0b,
|
||||||
"wait for systemd",
|
"wait for systemd",
|
||||||
\&primary_phase1,
|
\&primary_phase1,
|
||||||
|
|
Loading…
Reference in New Issue