In optimize_change(), I understand it tries to create new PGs with penalty to old PGs.
As far as I see, addpg means the number a PG increases, and delpg means the number a PG decreased. Is it?
But what's the meaning of "'max: '+all_pg_names.map(pg_name => (
prev_weights[pg_name] ? ${pg_size+1}*add_${pg_name} - ${pg_size+1}*del_${pg_name} : ${pg_size+1-move_weights[pg_name]}*${pg_name}
)).join(' + ')+';\n';" ?
Why (pg_size + 1) ?
And in OSD weight calculation, in "osd_pg_count = all_weights[osd]pg_effsize/total_weightpg_count - rm_osd_pg_count", why use rm_osd_pg_count ?
In optimize_change(), I understand it tries to create new PGs with penalty to old PGs.
As far as I see, addpg means the number a PG increases, and delpg means the number a PG decreased. Is it?
But what's the meaning of "'max: '+all_pg_names.map(pg_name => ( prev_weights[pg_name] ?
${pg_size+1}*add_${pg_name} - ${pg_size+1}*del_${pg_name}
:${pg_size+1-move_weights[pg_name]}*${pg_name}
)).join(' + ')+';\n';" ?Why (pg_size + 1) ?
And in OSD weight calculation, in "osd_pg_count = all_weights[osd]pg_effsize/total_weightpg_count - rm_osd_pg_count", why use rm_osd_pg_count ?