mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
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:
16
cmd/tier.go
16
cmd/tier.go
@@ -177,8 +177,24 @@ func (config *TierConfigMgr) Empty() bool {
|
||||
return len(config.ListTiers()) == 0
|
||||
}
|
||||
|
||||
// TierType returns the type of tier
|
||||
func (config *TierConfigMgr) TierType(name string) string {
|
||||
config.RLock()
|
||||
defer config.RUnlock()
|
||||
|
||||
cfg, ok := config.Tiers[name]
|
||||
if !ok {
|
||||
return "internal"
|
||||
}
|
||||
return cfg.Type.String()
|
||||
}
|
||||
|
||||
// ListTiers lists remote tiers configured in this deployment.
|
||||
func (config *TierConfigMgr) ListTiers() []madmin.TierConfig {
|
||||
if config == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
config.RLock()
|
||||
defer config.RUnlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user