Clear cache if reverting to backend (#8637)

Clear cached entry before reverting to backend for
encrypted objects or those under retention to avoid
stale objects remaining in cache.
master
poornas 5 years ago committed by Harshavardhana
parent ca62ac65d4
commit 80558e839d
  1. 2
      cmd/disk-cache.go

@ -585,12 +585,14 @@ func (c *cacheObjects) PutObject(ctx context.Context, bucket, object string, r *
return putObjectFn(ctx, bucket, object, r, opts)
}
if opts.ServerSideEncryption != nil {
dcache.Delete(ctx, bucket, object)
return putObjectFn(ctx, bucket, object, r, opts)
}
// skip cache for objects with locks
objRetention := getObjectRetentionMeta(opts.UserDefined)
if objRetention.Mode == Governance || objRetention.Mode == Compliance {
dcache.Delete(ctx, bucket, object)
return putObjectFn(ctx, bucket, object, r, opts)
}

Loading…
Cancel
Save