Please refer to https://docs.ceph.com/en/latest/ceph-volume/lvm/batch/ for
more detailed information.
+* Configuration variables for permitted scrub times have changed. The legal
+ values for ``osd_scrub_begin_hour`` and ``osd_scrub_end_hour`` are 0 - 23.
+ The use of 24 is now illegal. Specifying ``0`` for both values causes every
+ hour to be allowed. The legal vaues for ``osd_scrub_begin_week_day`` and
+ ``osd_scrub_end_week_day`` are 0 - 6. The use of 7 is now illegal.
+ Specifying ``0`` for both values causes every day of the week to be allowed.
+
+
>=15.0.0
--------
``osd scrub begin hour``
-:Description: The time of day for the lower bound when a scheduled scrub can be
- performed.
-:Type: Integer in the range of 0 to 24
+:Description: This restricts scrubbing to this hour of the day or later.
+ Use ``osd scrub begin hour = 0`` and ``osd scrub end hour = 0``
+ to allow scrubbing the entire day. Along with ``osd scrub end hour``, they define a time
+ window, in which the scrubs can happen.
+ But a scrub will be performed
+ no matter whether the time window allows or not, as long as the placement
+ group's scrub interval exceeds ``osd scrub max interval``.
+:Type: Integer in the range of 0 to 23
:Default: ``0``
``osd scrub end hour``
-:Description: The time of day for the upper bound when a scheduled scrub can be
- performed. Along with ``osd scrub begin hour``, they define a time
+:Description: This restricts scrubbing to the hour earlier than this.
+ Use ``osd scrub begin hour = 0`` and ``osd scrub end hour = 0`` to allow scrubbing
+ for the entire day. Along with ``osd scrub begin hour``, they define a time
window, in which the scrubs can happen. But a scrub will be performed
- no matter the time window allows or not, as long as the placement
+ no matter whether the time window allows or not, as long as the placement
group's scrub interval exceeds ``osd scrub max interval``.
-:Type: Integer in the range of 0 to 24
-:Default: ``24``
+:Type: Integer in the range of 0 to 23
+:Default: ``0``
``osd scrub begin week day``
:Description: This restricts scrubbing to this day of the week or later.
- 0 or 7 = Sunday, 1 = Monday, etc.
-:Type: Integer in the range of 0 to 7
+ 0 = Sunday, 1 = Monday, etc. Use ``osd scrub begin week day = 0``
+ and ``osd scrub end week day = 0`` to allow scrubbing for the entire week.
+ Along with ``osd scrub end week day``, they define a time window, in which
+ the scrubs can happen. But a scrub will be performed
+ no matter whether the time window allows or not, as long as the placement
+ group's scrub interval exceeds ``osd scrub max interval``.
+:Type: Integer in the range of 0 to 6
:Default: ``0``
``osd scrub end week day``
:Description: This restricts scrubbing to days of the week earlier than this.
- 0 or 7 = Sunday, 1 = Monday, etc.
-:Type: Integer in the range of 0 to 7
-:Default: ``7``
+ 0 = Sunday, 1 = Monday, etc. Use ``osd scrub begin week day = 0``
+ and ``osd scrub end week day = 0`` to allow scrubbing for the entire week.
+ Along with ``osd scrub begin week day``, they define a time
+ window, in which the scrubs can happen. But a scrub will be performed
+ no matter whether the time window allows or not, as long as the placement
+ group's scrub interval exceeds ``osd scrub max interval``.
+:Type: Integer in the range of 0 to 6
+:Default: ``0``
``osd scrub during recovery``
setup $dir || return 1
run_mon $dir a --osd_pool_default_size=3 || return 1
run_mgr $dir x || return 1
- local scrub_begin_hour=$(date -d '2 hour ago' +"%H" | sed 's/^0//')
- local scrub_end_hour=$(date -d '1 hour ago' +"%H" | sed 's/^0//')
for osd in $(seq 0 $(expr $OSDS - 1))
do
run_osd $dir $osd --osd_scrub_sleep=0 \
--osd_scrub_extended_sleep=10 \
--bluestore_cache_autotune=false \
- --osd_scrub_begin_hour=$scrub_begin_hour \
- --osd_scrub_end_hour=$scrub_end_hour || return 1
+ --osd_deep_scrub_randomize_ratio=0.0 \
+ --osd_scrub_interval_randomize_ratio=0 || return 1
done
# Create a pool with a single pg
_scrub_abort $dir deep_scrub
}
+function TEST_scrub_permit_time() {
+ local dir=$1
+ local poolname=test
+ local OSDS=3
+ local objects=15
+
+ TESTDATA="testdata.$$"
+
+ setup $dir || return 1
+ run_mon $dir a --osd_pool_default_size=3 || return 1
+ run_mgr $dir x || return 1
+ local scrub_begin_hour=$(date -d '2 hour ago' +"%H" | sed 's/^0//')
+ local scrub_end_hour=$(date -d '1 hour ago' +"%H" | sed 's/^0//')
+ for osd in $(seq 0 $(expr $OSDS - 1))
+ do
+ run_osd $dir $osd --bluestore_cache_autotune=false \
+ --osd_deep_scrub_randomize_ratio=0.0 \
+ --osd_scrub_interval_randomize_ratio=0 \
+ --osd_scrub_begin_hour=$scrub_begin_hour \
+ --osd_scrub_end_hour=$scrub_end_hour || return 1
+ done
+
+ # Create a pool with a single pg
+ create_pool $poolname 1 1
+ wait_for_clean || return 1
+
+ # Trigger a scrub on a PG
+ local pgid=$(get_pg $poolname SOMETHING)
+ local primary=$(get_primary $poolname SOMETHING)
+ local last_scrub=$(get_last_scrub_stamp $pgid)
+ # If we don't specify an amount of time to subtract from
+ # current time to set last_scrub_stamp, it sets the deadline
+ # back by osd_max_interval which would cause the time permit checking
+ # to be skipped. Set back 1 day, the default scrub_min_interval.
+ ceph tell $pgid scrub $(( 24 * 60 * 60 )) || return 1
+
+ # Scrub should not run
+ for ((i=0; i < 30; i++)); do
+ if test "$(get_last_scrub_stamp $pgid)" '>' "$last_scrub" ; then
+ return 1
+ fi
+ sleep 1
+ done
+
+ teardown $dir || return 1
+}
+
main osd-scrub-test "$@"
# Local Variables:
Option("osd_scrub_begin_hour", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(0)
+ .set_min_max(0, 23)
.set_description("Restrict scrubbing to this hour of the day or later")
+ .set_long_description("Use osd_scrub_begin_hour=0 and osd_scrub_end_hour=0 for the entire day.")
.add_see_also("osd_scrub_end_hour"),
Option("osd_scrub_end_hour", Option::TYPE_INT, Option::LEVEL_ADVANCED)
- .set_default(24)
+ .set_default(0)
+ .set_min_max(0, 23)
.set_description("Restrict scrubbing to hours of the day earlier than this")
+ .set_long_description("Use osd_scrub_begin_hour=0 and osd_scrub_end_hour=0 for the entire day.")
.add_see_also("osd_scrub_begin_hour"),
Option("osd_scrub_begin_week_day", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(0)
+ .set_min_max(0, 6)
.set_description("Restrict scrubbing to this day of the week or later")
- .set_long_description("0 or 7 = Sunday, 1 = Monday, etc.")
+ .set_long_description("0 = Sunday, 1 = Monday, etc. Use osd_scrub_begin_week_day=0 osd_scrub_end_week_day=0 for the entire week.")
.add_see_also("osd_scrub_end_week_day"),
Option("osd_scrub_end_week_day", Option::TYPE_INT, Option::LEVEL_ADVANCED)
- .set_default(7)
+ .set_default(0)
+ .set_min_max(0, 6)
.set_description("Restrict scrubbing to days of the week earlier than this")
- .set_long_description("0 or 7 = Sunday, 1 = Monday, etc.")
+ .set_long_description("0 = Sunday, 1 = Monday, etc. Use osd_scrub_begin_week_day=0 osd_scrub_end_week_day=0 for the entire week.")
.add_see_also("osd_scrub_begin_week_day"),
Option("osd_scrub_load_threshold", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)