to limit maximum preempt_divisor we can use when backing off the
chunky-scrub range on preempting.
Otherwise large osd_scrub_max_preemptions values (i.e., >= 32)
would cause preempt_divisor overflow, hence the dreaded
“divide by zero error”.
Fixes: https://tracker.ceph.com/issues/46024
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit
ae05de3e9b2e9868216e5168e50dfcb5074684cb)
Conflicts:
src/osd/PG.cc
- git got confused about where the change was/is
Option("osd_scrub_max_preemptions", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(5)
+ .set_min_max(0, 30)
.set_description("Set the maximum number of times we will preempt a deep scrub due to a client operation before blocking client IO to complete the scrub"),
Option("osd_deep_scrub_interval", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
* left end of the range if we are a tier because they may legitimately
* not exist (see _scrub).
*/
+ ceph_assert(scrubber.preempt_divisor > 0);
int min = std::max<int64_t>(3, cct->_conf->osd_scrub_chunk_min /
scrubber.preempt_divisor);
int max = std::max<int64_t>(min, cct->_conf->osd_scrub_chunk_max /