@@ -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