mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Encode dir obj names before expiration (#19305)
Object names of directory objects qualified for ExpiredObjectAllVersions must be encoded appropriately before calling on deletePrefix on their erasure set. e.g., a directory object and regular objects with overlapping prefixes could lead to the expiration of regular objects, which is not the intention of ILM. ``` bucket/dir/ ---> directory object bucket/dir/obj-1 ``` When `bucket/dir/` qualifies for expiration, the current implementation would remove regular objects under the prefix `bucket/dir/`, in this case, `bucket/dir/obj-1`.
This commit is contained in:
committed by
GitHub
parent
a03dac41eb
commit
da81c6cc27
@@ -1240,7 +1240,7 @@ func applyExpiryOnNonTransitionedObjects(ctx context.Context, objLayer ObjectLay
|
||||
}
|
||||
}()
|
||||
|
||||
dobj, err = objLayer.DeleteObject(ctx, obj.Bucket, obj.Name, opts)
|
||||
dobj, err = objLayer.DeleteObject(ctx, obj.Bucket, encodeDirObject(obj.Name), opts)
|
||||
if err != nil {
|
||||
if isErrObjectNotFound(err) || isErrVersionNotFound(err) {
|
||||
return false
|
||||
@@ -1261,7 +1261,9 @@ func applyExpiryOnNonTransitionedObjects(ctx context.Context, objLayer ObjectLay
|
||||
if obj.DeleteMarker {
|
||||
eventName = event.ObjectRemovedDeleteMarkerCreated
|
||||
}
|
||||
|
||||
if lcEvent.Action.DeleteAll() {
|
||||
eventName = event.ObjectRemovedDeleteAllVersions
|
||||
}
|
||||
// Notify object deleted event.
|
||||
sendEvent(eventArgs{
|
||||
EventName: eventName,
|
||||
|
||||
Reference in New Issue
Block a user