From 698c6ae014c50dbcdfb06f68efcf4ba325b872eb Mon Sep 17 00:00:00 2001 From: Ramana Raja Date: Sun, 7 Sep 2025 22:50:51 -0400 Subject: [PATCH] qa/workunits: add scenario to "test_force_promote_delete_group" ... in rbd_mirror_group_simple test suite. After the group and its images are removed from the secondary, the test can run in one of two scenarios. In Scenario 1, the test confirms that the group is completely synced from the primary to the secondary. In Scenario 2, the test disables and re-enables the primary, and then confirms the group syncs from the primary to the secondary. Currently, both of the scenarios fail occassionally when trying to confirm that group is completely synced from the primary to the secondary. Signed-off-by: Ramana Raja --- qa/workunits/rbd/rbd_mirror_group_simple.sh | 26 +++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/qa/workunits/rbd/rbd_mirror_group_simple.sh b/qa/workunits/rbd/rbd_mirror_group_simple.sh index 99c5b3ae1a5..fcbb8d52a0a 100755 --- a/qa/workunits/rbd/rbd_mirror_group_simple.sh +++ b/qa/workunits/rbd/rbd_mirror_group_simple.sh @@ -2736,9 +2736,10 @@ test_force_promote() 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() { @@ -2747,6 +2748,7 @@ 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 @@ -2762,11 +2764,7 @@ test_force_promote_delete_group() 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 @@ -2810,13 +2808,21 @@ test_force_promote_delete_group() 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}" -- 2.39.5