From: Nitzan Mordechai Date: Sun, 4 Jun 2023 08:28:56 +0000 (+0000) Subject: test: Divergent test 3 with pg_autoscale_mode on pick divergent osd X-Git-Tag: v18.2.1~213^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ea4f32a5bc65de3ce377ea1afba713cd7780f6b5;p=ceph-ci.git test: Divergent test 3 with pg_autoscale_mode on pick divergent osd When creating new pool, the current code pick the divergent osd by the first pg out of pg dump pgs, that can be in "unknown" status which means the up_primary = -1 and that will fail the test. We need to wait unitl the first pg is active+clean Fixes: https://tracker.ceph.com/issues/56034 Signed-off-by: Nitzan Mordechai (cherry picked from commit 13c640b5a82bf8f9b1aa5619416a4dbbb5d9a8d0) --- diff --git a/qa/standalone/osd/divergent-priors.sh b/qa/standalone/osd/divergent-priors.sh index dec0e7ad4e1..40d72544d1b 100755 --- a/qa/standalone/osd/divergent-priors.sh +++ b/qa/standalone/osd/divergent-priors.sh @@ -650,13 +650,28 @@ function TEST_divergent_3() { # reproduce https://tracker.ceph.com/issues/41816 ceph osd pool set $poolname pg_autoscale_mode on - flush_pg_stats || return 1 - wait_for_clean || return 1 + divergent=-1 + start_time=$(date +%s) + max_duration=300 + + while [ "$divergent" -le -1 ] + do + flush_pg_stats || return 1 + wait_for_clean || return 1 + + # determine primary + divergent="$(ceph pg dump pgs --format=json | jq '.pg_stats[0].up_primary')" + echo "primary and soon to be divergent is $divergent" + ceph pg dump pgs + + current_time=$(date +%s) + elapsed_time=$(expr $current_time - $start_time) + if [ "$elapsed_time" -gt "$max_duration" ]; then + echo "timed out waiting for divergent" + return 1 + fi + done - # determine primary - local divergent="$(ceph pg dump pgs --format=json | jq '.pg_stats[0].up_primary')" - echo "primary and soon to be divergent is $divergent" - ceph pg dump pgs local non_divergent="" for i in $osds do