Fix Ceph "pgs not deep-scrubbed in time" (PG_NOT_DEEP_SCRUBBED)
When PG_NOT_DEEP_SCRUBBED appears, check scrub flags, the allowed scrub window, then the interval settings — and see what raising the interval only postpones.
If ceph health shows PG_NOT_DEEP_SCRUBBED: 1161 pgs not deep-scrubbed in time, work through the steps below in order. The checks are read-only; commands that change settings are called out.
[1] List the late PGs. Each one is printed with the time of its last deep scrub.
# ceph health detailThe docs show lines like these:
[WRN] PG_NOT_DEEP_SCRUBBED: 1161 pgs not deep-scrubbed in timepg 86.fff not deep-scrubbed since 2024-08-21T02:35:25.733187+0000[2] Look for scrub flags. In the OSDMAP_FLAGS section the docs list noscrub and nodeep-scrub as the flags that disable scrubbing. A flag set during maintenance and forgotten shows up here.
# ceph health detailClear flags you no longer need. This changes the cluster.
# ceph osd unset nodeep-scrub# ceph osd unset noscrubThe same flags exist per pool (1 sets, 0 clears). If only one pool is blocked:
# ceph osd pool set <pool-name> nodeep-scrub 0[3] Check the scrub window. osd_scrub_begin_hour restricts scrubbing to that hour or later, osd_scrub_end_hour to hours earlier than that value. osd_scrub_begin_week_day and osd_scrub_end_week_day do the same for weekdays.
# ceph config get osd osd_scrub_begin_hour# ceph config get osd osd_scrub_end_hourA narrow window can be too short for a cluster with many PGs to finish its deep scrubs. Widen the window before you raise the interval. The commands below set the documented defaults (0, 0).
# ceph config set osd osd_scrub_begin_hour 0# ceph config set osd osd_scrub_end_hour 0[4] Check what stops a scrub from starting. The docs give these conditions:
- The PG must be
clean. Misplaced or degraded PGs are not scrubbed — fixPG_AVAILABILITYandPG_DEGRADEDfirst. - With
osd_scrub_during_recoveryatfalse(default), no scrubs run during recovery. - Periodic scrubs do not start when the normalized load (load average ÷ online CPUs) exceeds
osd_scrub_load_threshold(default10.0). - One OSD runs at most
osd_max_scrubsscrubs at a time (default3).
# ceph config get osd osd_scrub_during_recovery# ceph config get osd osd_scrub_load_threshold# ceph config get osd osd_max_scrubs[5] Check the interval. The default osd_deep_scrub_interval is 7 days. If one full deep-scrub round over big, numerous PGs takes longer, the warning stays. The docs name large clusters with many large PGs as a cause.
# ceph config get osd osd_deep_scrub_intervalThe documented procedure raises the interval, in seconds. The example 1209600 is 14 days. Set it for OSDs and the manager:
# ceph config set osd osd_deep_scrub_interval 1209600# ceph config set mgr osd_deep_scrub_interval 1209600The docs also show the global form:
# ceph config set global osd_deep_scrub_interval 1209600A single pool can have its own interval. The default 0 means "use the central osd_deep_scrub_interval".
# ceph osd pool get <pool-name> deep_scrub_interval# ceph osd pool set <pool-name> deep_scrub_interval <seconds>[6] To deep-scrub a late PG by hand, the docs give ceph pg deep-scrub <pgid>.
# ceph pg deep-scrub <pgid>[7] Run ceph health detail again. The warning shrinks as scrubs complete; it will not vanish at once.
Related: other warning codes are covered in Read Ceph HEALTH_WARN causes with health detail.