]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone/scrub: fix osd-scrub-test.sh
authorRonen Friedman <rfriedma@redhat.com>
Wed, 26 Jun 2024 15:02:19 +0000 (10:02 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 16 Jul 2024 14:19:33 +0000 (09:19 -0500)
following changes in scrub code

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
qa/standalone/scrub/osd-scrub-test.sh
qa/standalone/scrub/scrub-helpers.sh

index 171961676abdb2c8f52c5730a71f94b6b21e4a99..ec0066d955f4046797dc0033f1af909401f70c3f 100755 (executable)
@@ -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']}
index 3b0590fdfdef47d82e106c77b08d1bf71f5b0bc9..b0922892a4aca8f6e688a697d525c33b0463cc6c 100644 (file)
@@ -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") ),