start_mirrors "${secondary_cluster}"
}
-declare -a test_force_promote_delete_group_1=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${image_prefix}" 5)
+declare -a test_force_promote_delete_group_1=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${image_prefix}" 5 '')
+declare -a test_force_promote_delete_group_2=("${CLUSTER2}" "${CLUSTER1}" "${pool0}" "${image_prefix}" 5 'disable_reenable_primary')
-test_force_promote_delete_group_scenarios=1
+test_force_promote_delete_group_scenarios=2
test_force_promote_delete_group()
{
local pool=$1 ; shift
local image_prefix=$1 ; shift
local image_count=$(($1*"${image_multiplier}")) ; shift
+ local scenario=$1 ; shift
local group0=test-group0
wait_for_group_present "${secondary_cluster}" "${pool}" "${group0}" "${image_count}"
wait_for_group_replay_started "${secondary_cluster}" "${pool}"/"${group0}" "${image_count}"
wait_for_group_status_in_pool_dir "${secondary_cluster}" "${pool}"/"${group0}" 'up+replaying' "${image_count}"
-
- if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
- wait_for_group_status_in_pool_dir "${primary_cluster}" "${pool}"/"${group0}" 'up+stopped' "${image_count}"
- fi
-
+ wait_for_group_status_in_pool_dir "${primary_cluster}" "${pool}"/"${group0}" 'up+stopped' "${image_count}"
wait_for_group_synced "${primary_cluster}" "${pool}"/"${group0}" "${secondary_cluster}" "${pool}"/"${group0}"
# force promote the group on the secondary
group_remove "${secondary_cluster}" "${pool}/${group0}"
images_remove "${secondary_cluster}" "${pool}/${image_prefix}" "${image_count}"
- # disable and re-enable on original primary
- mirror_group_disable "${primary_cluster}" "${pool}/${group0}"
- mirror_group_enable "${primary_cluster}" "${pool}/${group0}"
+ if [ "${scenario}" = 'disable_reenable_primary' ]; then
+ # disable and re-enable on original primary
+ mirror_group_disable "${primary_cluster}" "${pool}/${group0}"
+ mirror_group_enable "${primary_cluster}" "${pool}/${group0}"
+ fi
# confirm that group is mirrored back to secondary
wait_for_group_present "${primary_cluster}" "${pool}" "${group0}" "${image_count}"
+ # TODO: Both scenarios 1 and 2 fail in the below step sometimes when the
+ # primary group does not get fully mirrored to the secondary.
wait_for_group_present "${secondary_cluster}" "${pool}" "${group0}" "${image_count}"
+ wait_for_group_replay_started "${secondary_cluster}" "${pool}"/"${group0}" "${image_count}"
+ wait_for_group_status_in_pool_dir "${secondary_cluster}" "${pool}"/"${group0}" 'up+replaying' "${image_count}"
+ wait_for_group_status_in_pool_dir "${primary_cluster}" "${pool}"/"${group0}" 'up+stopped' "${image_count}"
+ wait_for_group_synced "${primary_cluster}" "${pool}"/"${group0}" "${secondary_cluster}" "${pool}"/"${group0}"
# tidy up
mirror_group_disable "${primary_cluster}" "${pool}/${group0}"