mirror of https://github.com/schoebel/mars
test_suite: fix: use primary --force if network is cut yet
This commit is contained in:
parent
3a7ac7aab1
commit
f46383e0af
|
@ -373,13 +373,15 @@ function switch2primary_correct_split_brain
|
||||||
marsadm_do_cmd $new_secondary "leave-resource --force" "$res" || \
|
marsadm_do_cmd $new_secondary "leave-resource --force" "$res" || \
|
||||||
lib_exit 1
|
lib_exit 1
|
||||||
marsadm_do_cmd $new_primary "log-purge-all" "$res" || lib_exit 1
|
marsadm_do_cmd $new_primary "log-purge-all" "$res" || lib_exit 1
|
||||||
marsadm_do_cmd $new_primary "primary" "$res" || lib_exit 1
|
if [ $network_cut -eq 0 ]; then
|
||||||
|
marsadm_do_cmd $new_primary "primary" "$res" || lib_exit 1
|
||||||
|
else
|
||||||
|
marsadm_primary_force $new_primary $res
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# we need primary --force, because the deleted resource on the
|
# we need primary --force, because the deleted resource on the
|
||||||
# new_secondary does not switch from primary to secondary
|
# new_secondary does not switch from primary to secondary
|
||||||
marsadm_do_cmd $new_primary "disconnect" "$res" || lib_exit 1
|
marsadm_primary_force $new_primary $res
|
||||||
marsadm_do_cmd $new_primary "primary --force" "$res" || lib_exit 1
|
|
||||||
marsadm_do_cmd $new_primary "connect" "$res" || lib_exit 1
|
|
||||||
fi
|
fi
|
||||||
lib_vmsg " $switch2primary_flow_msg_prefix: check whether new primary $new_primary works standalone"
|
lib_vmsg " $switch2primary_flow_msg_prefix: check whether new primary $new_primary works standalone"
|
||||||
switch2primary_check_standalone_primary $new_primary $res
|
switch2primary_check_standalone_primary $new_primary $res
|
||||||
|
|
|
@ -300,3 +300,11 @@ function marsadm_host_is_designated_primary
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function marsadm_primary_force
|
||||||
|
{
|
||||||
|
local host=$1 res=$2
|
||||||
|
marsadm_do_cmd $host "disconnect" "$res" || lib_exit 1
|
||||||
|
marsadm_do_cmd $host "primary --force" "$res" || lib_exit 1
|
||||||
|
marsadm_do_cmd $host "connect" "$res" || lib_exit 1
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue