From 24647e87e8fba9b16d81730662b22798ed1885cb Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Wed, 26 Jun 2024 10:02:19 -0500 Subject: [PATCH] qa/standalone/scrub: fix osd-scrub-test.sh following changes in scrub code Signed-off-by: Ronen Friedman --- qa/standalone/scrub/osd-scrub-test.sh | 11 ++++++----- qa/standalone/scrub/scrub-helpers.sh | 14 +++++++++++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/qa/standalone/scrub/osd-scrub-test.sh b/qa/standalone/scrub/osd-scrub-test.sh index 171961676abdb..ec0066d955f40 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 @@ -604,8 +605,8 @@ function TEST_dump_scrub_schedule() { # scheduled for the future' value # - ceph tell osd.* config set osd_scrub_chunk_max "3" || return 1 - ceph tell osd.* config set osd_scrub_sleep "1.0" || return 1 + ceph tell osd.* config set osd_shallow_scrub_chunk_max "3" || return 1 + ceph tell osd.* config set osd_scrub_sleep "2.0" || return 1 ceph osd set noscrub || return 1 sleep 2 saved_last_stamp=${sched_data['query_last_stamp']} 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") ), -- 2.39.5