mirror of
https://github.com/minio/minio.git
synced 2025-04-19 02:05:24 -04:00
fix: allow missing hot-tier accounting (#18345)
This commit is contained in:
parent
4d40ee00e9
commit
ac8c43fe9c
@ -67,8 +67,6 @@ const (
|
|||||||
tierConfigFormat = 1
|
tierConfigFormat = 1
|
||||||
tierConfigV1 = 1
|
tierConfigV1 = 1
|
||||||
tierConfigVersion = 2
|
tierConfigVersion = 2
|
||||||
|
|
||||||
minioHotTier = "STANDARD"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// tierConfigPath refers to remote tier config object name
|
// tierConfigPath refers to remote tier config object name
|
||||||
|
@ -42,6 +42,7 @@ import (
|
|||||||
"github.com/klauspost/filepathx"
|
"github.com/klauspost/filepathx"
|
||||||
"github.com/minio/madmin-go/v3"
|
"github.com/minio/madmin-go/v3"
|
||||||
"github.com/minio/minio/internal/bucket/lifecycle"
|
"github.com/minio/minio/internal/bucket/lifecycle"
|
||||||
|
"github.com/minio/minio/internal/config/storageclass"
|
||||||
"github.com/minio/minio/internal/disk"
|
"github.com/minio/minio/internal/disk"
|
||||||
xioutil "github.com/minio/minio/internal/ioutil"
|
xioutil "github.com/minio/minio/internal/ioutil"
|
||||||
"github.com/minio/minio/internal/logger"
|
"github.com/minio/minio/internal/logger"
|
||||||
@ -550,6 +551,10 @@ func (s *xlStorage) NSScanner(ctx context.Context, cache dataUsageCache, updates
|
|||||||
}
|
}
|
||||||
sizeS.tiers[tier.Name] = tierStats{}
|
sizeS.tiers[tier.Name] = tierStats{}
|
||||||
}
|
}
|
||||||
|
if sizeS.tiers != nil {
|
||||||
|
sizeS.tiers[storageclass.STANDARD] = tierStats{}
|
||||||
|
sizeS.tiers[storageclass.RRS] = tierStats{}
|
||||||
|
}
|
||||||
|
|
||||||
done := globalScannerMetrics.time(scannerMetricApplyAll)
|
done := globalScannerMetrics.time(scannerMetricApplyAll)
|
||||||
objInfos, err := item.applyVersionActions(ctx, objAPI, fivs.Versions)
|
objInfos, err := item.applyVersionActions(ctx, objAPI, fivs.Versions)
|
||||||
@ -588,7 +593,7 @@ func (s *xlStorage) NSScanner(ctx context.Context, cache dataUsageCache, updates
|
|||||||
}
|
}
|
||||||
tier := oi.StorageClass
|
tier := oi.StorageClass
|
||||||
if tier == "" {
|
if tier == "" {
|
||||||
tier = minioHotTier
|
tier = storageclass.STANDARD // no SC means "STANDARD"
|
||||||
}
|
}
|
||||||
if oi.TransitionedObject.Status == lifecycle.TransitionComplete {
|
if oi.TransitionedObject.Status == lifecycle.TransitionComplete {
|
||||||
tier = oi.TransitionedObject.Tier
|
tier = oi.TransitionedObject.Tier
|
||||||
@ -618,11 +623,9 @@ func (s *xlStorage) NSScanner(ctx context.Context, cache dataUsageCache, updates
|
|||||||
res["versions"] = strconv.FormatUint(sizeS.versions, 10)
|
res["versions"] = strconv.FormatUint(sizeS.versions, 10)
|
||||||
}
|
}
|
||||||
res["size"] = strconv.FormatInt(sizeS.totalSize, 10)
|
res["size"] = strconv.FormatInt(sizeS.totalSize, 10)
|
||||||
if len(sizeS.tiers) > 0 {
|
for name, tier := range sizeS.tiers {
|
||||||
for name, tier := range sizeS.tiers {
|
res["tier-size-"+name] = strconv.FormatUint(tier.TotalSize, 10)
|
||||||
res["tier-size-"+name] = strconv.FormatUint(tier.TotalSize, 10)
|
res["tier-versions-"+name] = strconv.Itoa(tier.NumVersions)
|
||||||
res["tier-versions-"+name] = strconv.Itoa(tier.NumVersions)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if sizeS.failedCount > 0 {
|
if sizeS.failedCount > 0 {
|
||||||
res["repl-failed"] = fmt.Sprintf("%d versions, %d bytes", sizeS.failedCount, sizeS.failedSize)
|
res["repl-failed"] = fmt.Sprintf("%d versions, %d bytes", sizeS.failedCount, sizeS.failedSize)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user