Schedule automatic scrubs correctly (not just after previous scrub)

This commit is contained in:
Vitaliy Filippov
2023-05-20 23:20:09 +03:00
parent 8d40ad99a6
commit fa90b5a4e7
4 changed files with 33 additions and 5 deletions
+9
View File
@@ -210,6 +210,7 @@ void osd_t::parse_config(bool init)
inode_vanish_time = config["inode_vanish_time"].uint64_value();
if (!inode_vanish_time)
inode_vanish_time = 60;
auto old_auto_scrub = auto_scrub;
auto_scrub = json_is_true(config["auto_scrub"]);
global_scrub_interval = parse_time(config["scrub_interval"].string_value());
if (!global_scrub_interval)
@@ -224,6 +225,14 @@ void osd_t::parse_config(bool init)
scrub_list_limit = config["scrub_list_limit"].uint64_value();
if (!scrub_list_limit)
scrub_list_limit = 1000;
if (!old_auto_scrub && auto_scrub)
{
// Schedule scrubbing
for (auto & pgp: pgs)
{
plan_scrub(pgp.second);
}
}
if (old_no_scrub && !no_scrub)
{
// Wakeup scrubbing