Skip to content

Commit 24647e8

Browse files
committed
qa/standalone/scrub: fix osd-scrub-test.sh
following changes in scrub code Signed-off-by: Ronen Friedman <[email protected]>
1 parent 8a8fa48 commit 24647e8

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

qa/standalone/scrub/osd-scrub-test.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ function TEST_dump_scrub_schedule() {
540540
--osd_scrub_interval_randomize_ratio=0 \
541541
--osd_scrub_backoff_ratio=0.0 \
542542
--osd_op_queue=wpq \
543-
--osd_stats_update_period_not_scrubbing=3 \
544-
--osd_stats_update_period_scrubbing=2 \
543+
--osd_stats_update_period_not_scrubbing=1 \
544+
--osd_stats_update_period_scrubbing=1 \
545545
--osd_scrub_sleep=0.2"
546546

547547
for osd in $(seq 0 $(expr $OSDS - 1))
@@ -562,7 +562,8 @@ function TEST_dump_scrub_schedule() {
562562
rm -f $TESTDATA
563563

564564
local pgid="${poolid}.0"
565-
local now_is=`date -I"ns"`
565+
#local now_is=`date -I"ns"` # note: uses a comma for the ns part
566+
local now_is=`date +'%Y-%m-%dT%H:%M:%S.%N%:z'`
566567

567568
# before the scrubbing starts
568569

@@ -604,8 +605,8 @@ function TEST_dump_scrub_schedule() {
604605
# scheduled for the future' value
605606
#
606607

607-
ceph tell osd.* config set osd_scrub_chunk_max "3" || return 1
608-
ceph tell osd.* config set osd_scrub_sleep "1.0" || return 1
608+
ceph tell osd.* config set osd_shallow_scrub_chunk_max "3" || return 1
609+
ceph tell osd.* config set osd_scrub_sleep "2.0" || return 1
609610
ceph osd set noscrub || return 1
610611
sleep 2
611612
saved_last_stamp=${sched_data['query_last_stamp']}

qa/standalone/scrub/scrub-helpers.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function extract_published_sch() {
1818
local -n dict=$4 # a ref to the in/out dictionary
1919
local current_time=$2
2020
local extra_time=$3
21-
local extr_dbg=1 # note: 3 and above leave some temp files around
21+
local extr_dbg=2 # note: 3 and above leave some temp files around
2222

2323
#turn off '-x' (but remember previous state)
2424
local saved_echo_flag=${-//[^x]/}
@@ -51,18 +51,26 @@ function extract_published_sch() {
5151
(( extr_dbg >= 2 )) && echo "query output:"
5252
(( extr_dbg >= 2 )) && ceph pg $1 query -f json-pretty | awk -e '/scrubber/,/agent_state/ {print;}'
5353

54+
# note: the query output for the schedule containas two dates: the first is the not-before, and
55+
# the second is the original target time (which is before or the same as the not-before)
56+
# the current line format looks like this:
57+
# "schedule": "scrub scheduled @ 2024-06-26T16:09:56.666 (2024-06-24T16:09:56.338)"
5458
from_qry=`ceph pg $1 query -f json-pretty | jq -r --arg extra_dt "$extra_time" --arg current_dt "$current_time" --arg spt "'" '
5559
. |
5660
(.q_stat_part=((.scrubber.schedule// "-") | if test(".*@.*") then (split(" @ ")|first) else . end)) |
5761
(.q_when_part=((.scrubber.schedule// "0") | if test(".*@.*") then (split(" @ ")|last) else "0" end)) |
58-
(.q_when_is_future=(.q_when_part > $current_dt)) |
62+
(.q_target=((.scrubber.schedule// "0") | if test(".*@.*") then (split(" @ ")|last|split(" (")|last|split(")")|first) else "0" end)) |
63+
(.q_not_before=((.scrubber.schedule// "0") | if test(".*@.*") then (split(" @ ")|last|split(" (")|first) else "0" end)) |
64+
(.q_when_is_future=(.q_target > $current_dt)) |
5965
(.q_vs_date=(.q_when_part > $extra_dt)) |
6066
{
6167
query_epoch: .epoch,
6268
query_seq: .info.stats.reported_seq,
6369
query_active: (.scrubber | if has("active") then .active else "bug" end),
6470
query_schedule: .q_stat_part,
65-
query_schedule_at: .q_when_part,
71+
#query_schedule_at: .q_when_part,
72+
query_schedule_at: .q_not_before,
73+
query_target_at: .q_target,
6674
query_last_duration: .info.stats.last_scrub_duration,
6775
query_last_stamp: .info.history.last_scrub_stamp,
6876
query_last_scrub: (.info.history.last_scrub| sub($spt;"x") ),

0 commit comments

Comments
 (0)