diff --git a/cmd/bucket-metadata-sys.go b/cmd/bucket-metadata-sys.go index d1c951ef7..294eec773 100644 --- a/cmd/bucket-metadata-sys.go +++ b/cmd/bucket-metadata-sys.go @@ -49,6 +49,7 @@ func (sys *BucketMetadataSys) Remove(bucket string) { } sys.Lock() delete(sys.metadataMap, bucket) + globalBucketMonitor.DeleteBucket(bucket) sys.Unlock() } diff --git a/pkg/bucket/bandwidth/monitor.go b/pkg/bucket/bandwidth/monitor.go index 2ec5d5376..243c181d8 100644 --- a/pkg/bucket/bandwidth/monitor.go +++ b/pkg/bucket/bandwidth/monitor.go @@ -170,3 +170,10 @@ func (m *Monitor) track(bucket string, object string, timeNow time.Time) *bucket b := m.getBucketMeasurement(bucket, timeNow) return b } + +func (m *Monitor) DeleteBucket(bucket string) { + m.lock.Lock() + defer m.lock.Unlock() + delete(m.activeBuckets, bucket) + delete(m.bucketThrottle, bucket) +}