mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -05:00
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.
This commit is contained in:
parent
ca62ac65d4
commit
80558e839d
@ -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…
Reference in New Issue
Block a user