Browse Source

Ignore zero OSDs in history osd_sets

pull/5/head
Vitaliy Filippov 3 years ago
parent
commit
b44f49aab2
  1. 3
      mon/mon.js
  2. 14
      src/osd_peering.cpp

3
mon/mon.js

@ -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 || [];

14
src/osd_peering.cpp

@ -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…
Cancel
Save