@@ -71,8 +71,8 @@ class ScrubJob final : public RefCountedObject {
7171 */
7272 std::atomic_bool in_queues{false };
7373
74- // / last scrub attempt failed to secure replica resources
75- bool resources_failure{ false };
74+ // / how the last attempt to scrub this PG ended
75+ delay_cause_t last_issue{ delay_cause_t ::none };
7676
7777 /* *
7878 * 'updated' is a temporary flag, used to create a barrier after
@@ -118,6 +118,15 @@ class ScrubJob final : public RefCountedObject {
118118 const scrub_schedule_t & adjusted,
119119 bool reset_failure_penalty);
120120
121+ /* *
122+ * push the 'not_before' time out by 'delay' seconds, so that this scrub target
123+ * would not be retried before 'delay' seconds have passed.
124+ */
125+ void delay_on_failure (
126+ std::chrono::seconds delay,
127+ delay_cause_t delay_cause,
128+ utime_t scrub_clock_now);
129+
121130 void dump (ceph::Formatter* f) const ;
122131
123132 /*
@@ -227,6 +236,20 @@ struct formatter<Scrub::qu_state_t> : formatter<std::string_view> {
227236 }
228237};
229238
239+ template <>
240+ struct formatter <Scrub::sched_params_t > {
241+ constexpr auto parse (format_parse_context& ctx) { return ctx.begin (); }
242+ template <typename FormatContext>
243+ auto format (const Scrub::sched_params_t & pm, FormatContext& ctx)
244+ {
245+ return fmt::format_to (
246+ ctx.out (), " (proposed:{:s} min/max:{:.3f}/{:.3f} must:{:2s})" ,
247+ utime_t {pm.proposed_time }, pm.min_interval , pm.max_interval ,
248+ pm.is_must == Scrub::must_scrub_t ::mandatory ? " true" : " false" );
249+ }
250+ };
251+
252+
230253template <>
231254struct formatter <Scrub::ScrubJob> {
232255 constexpr auto parse (format_parse_context& ctx) { return ctx.begin (); }
@@ -235,12 +258,10 @@ struct formatter<Scrub::ScrubJob> {
235258 auto format (const Scrub::ScrubJob& sjob, FormatContext& ctx)
236259 {
237260 return fmt::format_to (
238- ctx.out (),
239- " pg[{}] @ {:s} ({:s}) (dl:{:s}) - <{}> / failure: {} / queue state: "
240- " {:.7}" ,
261+ ctx.out (), " pg[{}] @ nb:{:s} ({:s}) (dl:{:s}) - <{}> queue state:{:.7}" ,
241262 sjob.pgid , sjob.schedule .not_before , sjob.schedule .scheduled_at ,
242263 sjob.schedule .deadline , sjob.registration_state (),
243- sjob.resources_failure , sjob. state .load (std::memory_order_relaxed));
264+ sjob.state .load (std::memory_order_relaxed));
244265 }
245266};
246267
0 commit comments