Ignore zero OSDs in history osd_sets

This commit is contained in:
Vitaliy Filippov
2021-03-12 12:40:15 +03:00
parent 036555638e
commit b44f49aab2
2 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -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 || [];