Do not start EC PGs without at least pg_data_size connections to old OSDs from each set

Vitaliy Filippov 2023-06-17 00:55:43 +03:00
parent affe8fc270
commit aa5dacc7a9
1 changed files with 4 additions and 5 deletions

View File

@ -240,21 +240,20 @@ void osd_t::start_pg_peering(pg_t & pg)
// (PG history is kept up to the latest active+clean state)
for (auto & history_set: pg.target_history)
{
bool found = true;
int nonzero = 0, found = 0;
for (auto history_osd: history_set)
{
if (history_osd != 0)
{
found = false;
nonzero++;
if (history_osd == this->osd_num ||
msgr.osd_peer_fds.find(history_osd) != msgr.osd_peer_fds.end())
{
found = true;
break;
found++;
}
}
}
if (!found)
if (found < (nonzero >= pg.pg_data_size ? pg.pg_data_size : 1))
{
pg.state = PG_INCOMPLETE;
report_pg_state(pg);