Make OSD sort & sanitize PG history items

This commit is contained in:
Vitaliy Filippov
2023-01-01 23:17:42 +03:00
parent 0593e5c21c
commit 67019f5b02
4 changed files with 39 additions and 13 deletions
+7 -4
View File
@@ -92,12 +92,15 @@ void pg_obj_state_check_t::walk()
for (auto peer_osd: pg->cur_set)
{
if (peer_osd != 0)
{
history_set.push_back(peer_osd);
}
}
pg->target_history.push_back(history_set);
pg->history_changed = true;
std::sort(history_set.begin(), history_set.end());
auto it = std::lower_bound(pg->target_history.begin(), pg->target_history.end(), history_set);
if (it == pg->target_history.end() || *it != history_set)
{
pg->target_history.insert(it, history_set);
pg->history_changed = true;
}
}
else
{