make sure to delete data-usage cache upon bucket deletes (#9952)

master
Harshavardhana 4 years ago committed by GitHub
parent 2e338e84cb
commit 5388ae4acb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      cmd/bucket-metadata.go

@ -319,9 +319,15 @@ func (b *BucketMetadata) Save(ctx context.Context, api ObjectLayer) error {
// deleteBucketMetadata deletes bucket metadata // deleteBucketMetadata deletes bucket metadata
// If config does not exist no error is returned. // If config does not exist no error is returned.
func deleteBucketMetadata(ctx context.Context, obj ObjectLayer, bucket string) error { func deleteBucketMetadata(ctx context.Context, obj ObjectLayer, bucket string) error {
configFile := path.Join(bucketConfigPrefix, bucket, bucketMetadataFile) metadataFiles := []string{
if err := deleteConfig(ctx, obj, configFile); err != nil && err != errConfigNotFound { dataUsageCacheName,
return err bucketMetadataFile,
}
for _, metaFile := range metadataFiles {
configFile := path.Join(bucketConfigPrefix, bucket, metaFile)
if err := deleteConfig(ctx, obj, configFile); err != nil && err != errConfigNotFound {
return err
}
} }
return nil return nil
} }

Loading…
Cancel
Save