mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -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)
|
return putObjectFn(ctx, bucket, object, r, opts)
|
||||||
}
|
}
|
||||||
if opts.ServerSideEncryption != nil {
|
if opts.ServerSideEncryption != nil {
|
||||||
|
dcache.Delete(ctx, bucket, object)
|
||||||
return putObjectFn(ctx, bucket, object, r, opts)
|
return putObjectFn(ctx, bucket, object, r, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip cache for objects with locks
|
// skip cache for objects with locks
|
||||||
objRetention := getObjectRetentionMeta(opts.UserDefined)
|
objRetention := getObjectRetentionMeta(opts.UserDefined)
|
||||||
if objRetention.Mode == Governance || objRetention.Mode == Compliance {
|
if objRetention.Mode == Governance || objRetention.Mode == Compliance {
|
||||||
|
dcache.Delete(ctx, bucket, object)
|
||||||
return putObjectFn(ctx, bucket, object, r, opts)
|
return putObjectFn(ctx, bucket, object, r, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user