fix: tiering statistics handling a bug in clone() implementation (#18342)

Tiering statistics have been broken for some time now, a regression
was introduced in 6f2406b0b6

Bonus fixes an issue where the objects are not assumed to be
of the 'STANDARD' storage-class for the objects that have
not yet tiered, this should be conditional based on the object's
metadata not a default assumption.

This PR also does some cleanup in terms of implementation,

fixes #18070
This commit is contained in:
Harshavardhana
2023-10-30 09:59:51 -07:00
committed by GitHub
parent ef67c39910
commit 877e0cac03
7 changed files with 71 additions and 63 deletions

View File

@@ -101,9 +101,8 @@ func (l DailyAllTierStats) merge(m DailyAllTierStats) {
func (l DailyAllTierStats) addToTierInfo(tierInfos []madmin.TierInfo) []madmin.TierInfo {
for i := range tierInfos {
var lst lastDayTierStats
var ok bool
if lst, ok = l[tierInfos[i].Name]; !ok {
lst, ok := l[tierInfos[i].Name]
if !ok {
continue
}
for hr, st := range lst.Bins {