forked from vitalif/vitastor
Ignore zero OSDs in history osd_sets
parent
036555638e
commit
b44f49aab2
|
@ -655,7 +655,8 @@ class Mon
|
|||
osd_set,
|
||||
primary: alive_set.length ? alive_set[Math.floor(Math.random()*alive_set.length)] : 0,
|
||||
};
|
||||
if (prev_pgs[i] && prev_pgs[i].join(' ') != osd_set.join(' '))
|
||||
if (prev_pgs[i] && prev_pgs[i].join(' ') != osd_set.join(' ') &&
|
||||
prev_pgs[i].filter(osd_num => osd_num).length > 0)
|
||||
{
|
||||
pg_history[i] = pg_history[i] || {};
|
||||
pg_history[i].osd_sets = pg_history[i].osd_sets || [];
|
||||
|
|
|
@ -180,14 +180,18 @@ 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 = false;
|
||||
bool found = true;
|
||||
for (auto history_osd: history_set)
|
||||
{
|
||||
if (history_osd != 0 && (history_osd == this->osd_num ||
|
||||
c_cli.osd_peer_fds.find(history_osd) != c_cli.osd_peer_fds.end()))
|
||||
if (history_osd != 0)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
found = false;
|
||||
if (history_osd == this->osd_num ||
|
||||
c_cli.osd_peer_fds.find(history_osd) != c_cli.osd_peer_fds.end())
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
|
|
Loading…
Reference in New Issue