@ -847,9 +847,15 @@ class Mon
this . filter _osds _by _tags ( osd _tree , pool _tree , pool _cfg . osd _tags ) ;
// These are for the purpose of building history.osd_sets
const real _prev _pgs = [ ] ;
let pg _history = [ ] ;
for ( const pg in ( ( this . state . config . pgs . items || { } ) [ pool _id ] || { } ) )
{
real _prev _pgs [ pg - 1 ] = this . state . config . pgs . items [ pool _id ] [ pg ] . osd _set ;
if ( this . state . pg . history [ pool _id ] &&
this . state . pg . history [ pool _id ] [ pg ] )
{
pg _history [ pg - 1 ] = this . state . pg . history [ pool _id ] [ pg ] ;
}
}
// And these are for the purpose of minimizing data movement
let prev _pgs = [ ] ;
@ -858,7 +864,6 @@ class Mon
prev _pgs [ pg - 1 ] = this . state . history . last _clean _pgs . items [ pool _id ] [ pg ] . osd _set ;
}
prev _pgs = JSON . parse ( JSON . stringify ( prev _pgs . length ? prev _pgs : real _prev _pgs ) ) ;
const pg _history = [ ] ;
const old _pg _count = prev _pgs . length ;
let optimize _result ;
if ( old _pg _count > 0 )
@ -871,7 +876,9 @@ class Mon
this . schedule _recheck ( ) ;
return ;
}
PGUtil . scale _pg _count ( prev _pgs , this . state . pg . history [ pool _id ] || { } , pg _history , pool _cfg . pg _count ) ;
const new _pg _history = [ ] ;
PGUtil . scale _pg _count ( prev _pgs , pg _history , new _pg _history , pool _cfg . pg _count ) ;
pg _history = new _pg _history ;
}
for ( const pg of prev _pgs )
{