Fix auto_scrubs not starting because of < vs <= =))
This commit is contained in:
+4
-2
@@ -485,6 +485,10 @@ void osd_t::report_pg_state(pg_t & pg)
|
|||||||
{
|
{
|
||||||
pg.print_state();
|
pg.print_state();
|
||||||
this->pg_state_dirty.insert({ .pool_id = pg.pool_id, .pg_num = pg.pg_num });
|
this->pg_state_dirty.insert({ .pool_id = pg.pool_id, .pg_num = pg.pg_num });
|
||||||
|
if (pg.state & PG_ACTIVE)
|
||||||
|
{
|
||||||
|
plan_scrub(pg, false);
|
||||||
|
}
|
||||||
if (pg.state == PG_ACTIVE && (pg.target_history.size() > 0 || pg.all_peers.size() > pg.target_set.size()))
|
if (pg.state == PG_ACTIVE && (pg.target_history.size() > 0 || pg.all_peers.size() > pg.target_set.size()))
|
||||||
{
|
{
|
||||||
// Clear history of active+clean PGs
|
// Clear history of active+clean PGs
|
||||||
@@ -493,7 +497,6 @@ void osd_t::report_pg_state(pg_t & pg)
|
|||||||
pg.all_peers = pg.target_set;
|
pg.all_peers = pg.target_set;
|
||||||
std::sort(pg.all_peers.begin(), pg.all_peers.end());
|
std::sort(pg.all_peers.begin(), pg.all_peers.end());
|
||||||
pg.cur_peers = pg.target_set;
|
pg.cur_peers = pg.target_set;
|
||||||
plan_scrub(pg, false);
|
|
||||||
// Change pg_config at the same time, otherwise our PG reconciling loop may try to apply the old metadata
|
// Change pg_config at the same time, otherwise our PG reconciling loop may try to apply the old metadata
|
||||||
auto & pg_cfg = st_cli.pool_config[pg.pool_id].pg_config[pg.pg_num];
|
auto & pg_cfg = st_cli.pool_config[pg.pool_id].pg_config[pg.pg_num];
|
||||||
pg_cfg.target_history = pg.target_history;
|
pg_cfg.target_history = pg.target_history;
|
||||||
@@ -537,7 +540,6 @@ void osd_t::report_pg_state(pg_t & pg)
|
|||||||
pg.cur_peers.push_back(pg_osd);
|
pg.cur_peers.push_back(pg_osd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
plan_scrub(pg, false);
|
|
||||||
auto & pg_cfg = st_cli.pool_config[pg.pool_id].pg_config[pg.pg_num];
|
auto & pg_cfg = st_cli.pool_config[pg.pool_id].pg_config[pg.pg_num];
|
||||||
pg_cfg.target_history = pg.target_history;
|
pg_cfg.target_history = pg.target_history;
|
||||||
pg_cfg.all_peers = pg.all_peers;
|
pg_cfg.all_peers = pg.all_peers;
|
||||||
|
|||||||
+2
-2
@@ -131,7 +131,7 @@ int osd_t::pick_next_scrub(object_id & next_oid)
|
|||||||
}
|
}
|
||||||
while (pg_it != pgs.end())
|
while (pg_it != pgs.end())
|
||||||
{
|
{
|
||||||
if ((pg_it->second.state & PG_ACTIVE) && pg_it->second.next_scrub && pg_it->second.next_scrub < tv_now.tv_sec)
|
if ((pg_it->second.state & PG_ACTIVE) && pg_it->second.next_scrub && pg_it->second.next_scrub <= tv_now.tv_sec)
|
||||||
{
|
{
|
||||||
// Continue scrubbing from the next object
|
// Continue scrubbing from the next object
|
||||||
if (scrub_last_pg == pg_it->first)
|
if (scrub_last_pg == pg_it->first)
|
||||||
@@ -350,7 +350,7 @@ void osd_t::schedule_scrub(pg_t & pg)
|
|||||||
tfd->clear_timer(scrub_timer_id);
|
tfd->clear_timer(scrub_timer_id);
|
||||||
scrub_timer_id = -1;
|
scrub_timer_id = -1;
|
||||||
}
|
}
|
||||||
if (tv_now.tv_sec > scrub_nearest_ts)
|
if (tv_now.tv_sec >= scrub_nearest_ts)
|
||||||
{
|
{
|
||||||
scrub_nearest_ts = 0;
|
scrub_nearest_ts = 0;
|
||||||
peering_state = peering_state | OSD_SCRUBBING;
|
peering_state = peering_state | OSD_SCRUBBING;
|
||||||
|
|||||||
Reference in New Issue
Block a user