From: Ronen Friedman Date: Wed, 26 Jun 2024 15:02:19 +0000 (-0500) Subject: qa/standalone/scrub: fix osd-scrub-test.sh X-Git-Tag: v19.2.3~178^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9db0c467a997af0d0e20bd6301ac0a633ce00710;p=ceph.git qa/standalone/scrub: fix osd-scrub-test.sh following changes in scrub code (cherry picked from commit 24647e87e8fba9b16d81730662b22798ed1885cb) Conflict resolved by: - electing to keep the up-to-date order between 'set noscrub' and 'set ..chunk_max' in 'step 2' Signed-off-by: Ronen Friedman --- diff --git a/qa/standalone/scrub/osd-scrub-test.sh b/qa/standalone/scrub/osd-scrub-test.sh index 01174a30ed56c..daa060d87a1d1 100755 --- a/qa/standalone/scrub/osd-scrub-test.sh +++ b/qa/standalone/scrub/osd-scrub-test.sh @@ -540,8 +540,8 @@ function TEST_dump_scrub_schedule() { --osd_scrub_interval_randomize_ratio=0 \ --osd_scrub_backoff_ratio=0.0 \ --osd_op_queue=wpq \ - --osd_stats_update_period_not_scrubbing=3 \ - --osd_stats_update_period_scrubbing=2 \ + --osd_stats_update_period_not_scrubbing=1 \ + --osd_stats_update_period_scrubbing=1 \ --osd_scrub_sleep=0.2" for osd in $(seq 0 $(expr $OSDS - 1)) @@ -562,7 +562,8 @@ function TEST_dump_scrub_schedule() { rm -f $TESTDATA local pgid="${poolid}.0" - local now_is=`date -I"ns"` + #local now_is=`date -I"ns"` # note: uses a comma for the ns part + local now_is=`date +'%Y-%m-%dT%H:%M:%S.%N%:z'` # before the scrubbing starts @@ -612,6 +613,7 @@ function TEST_dump_scrub_schedule() { ceph tell $pgid schedule-scrub sleep 1 sched_data=() + declare -A expct_scrub_peri_sched=( ['query_is_future']="false" ) wait_any_cond $pgid 10 $saved_last_stamp expct_scrub_peri_sched "waitingBeingScheduled" sched_data || return 1 diff --git a/qa/standalone/scrub/scrub-helpers.sh b/qa/standalone/scrub/scrub-helpers.sh index 3b0590fdfdef4..b0922892a4aca 100644 --- a/qa/standalone/scrub/scrub-helpers.sh +++ b/qa/standalone/scrub/scrub-helpers.sh @@ -18,7 +18,7 @@ function extract_published_sch() { local -n dict=$4 # a ref to the in/out dictionary local current_time=$2 local extra_time=$3 - local extr_dbg=1 # note: 3 and above leave some temp files around + local extr_dbg=2 # note: 3 and above leave some temp files around #turn off '-x' (but remember previous state) local saved_echo_flag=${-//[^x]/} @@ -51,18 +51,26 @@ function extract_published_sch() { (( extr_dbg >= 2 )) && echo "query output:" (( extr_dbg >= 2 )) && ceph pg $1 query -f json-pretty | awk -e '/scrubber/,/agent_state/ {print;}' + # note: the query output for the schedule containas two dates: the first is the not-before, and + # the second is the original target time (which is before or the same as the not-before) + # the current line format looks like this: + # "schedule": "scrub scheduled @ 2024-06-26T16:09:56.666 (2024-06-24T16:09:56.338)" from_qry=`ceph pg $1 query -f json-pretty | jq -r --arg extra_dt "$extra_time" --arg current_dt "$current_time" --arg spt "'" ' . | (.q_stat_part=((.scrubber.schedule// "-") | if test(".*@.*") then (split(" @ ")|first) else . end)) | (.q_when_part=((.scrubber.schedule// "0") | if test(".*@.*") then (split(" @ ")|last) else "0" end)) | - (.q_when_is_future=(.q_when_part > $current_dt)) | + (.q_target=((.scrubber.schedule// "0") | if test(".*@.*") then (split(" @ ")|last|split(" (")|last|split(")")|first) else "0" end)) | + (.q_not_before=((.scrubber.schedule// "0") | if test(".*@.*") then (split(" @ ")|last|split(" (")|first) else "0" end)) | + (.q_when_is_future=(.q_target > $current_dt)) | (.q_vs_date=(.q_when_part > $extra_dt)) | { query_epoch: .epoch, query_seq: .info.stats.reported_seq, query_active: (.scrubber | if has("active") then .active else "bug" end), query_schedule: .q_stat_part, - query_schedule_at: .q_when_part, + #query_schedule_at: .q_when_part, + query_schedule_at: .q_not_before, + query_target_at: .q_target, query_last_duration: .info.stats.last_scrub_duration, query_last_stamp: .info.history.last_scrub_stamp, query_last_scrub: (.info.history.last_scrub| sub($spt;"x") ),