mirror of
https://github.com/pgsty/minio.git
synced 2026-11-10 09:35:31 +03:00
fix(batch): authorize the versions that a purge of all versions deletes
A batch expiration that keeps no versions authorized the versions its walk saw, and the purge then deleted the versions it read under its lock. A version written after the walk, or tags changed on one since, was deleted without being authorized for the submitter. The purge takes an authorization that a batch purge must set and no other delete may. Under the object lock, once it has approved the history and checked every drive, and before its first delete, it hands the writes it is about to delete to the job: every copy of every approved version and every revision of one that a drive holds, one per distinct version ID and tags, as they are then. The job evaluates the expire actions on each for the submitter. A denial deletes nothing and ends the job as refused; the time it takes counts against the purge's budget. A locked version still refuses the whole key, counted as a refused key. The checks on the walk's snapshot are removed. Reviewed adversarially; the review's regressions are included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -1234,7 +1234,7 @@ func (z *erasureServerPools) DeleteObject(ctx context.Context, bucket string, ob
|
||||
if err = checkDelObjArgs(ctx, bucket, object); err != nil {
|
||||
return objInfo, err
|
||||
}
|
||||
if opts.DeleteAllVersions {
|
||||
if opts.DeleteAllVersions || opts.deleteAllAuthorize != nil {
|
||||
if err := opts.deleteAllInvalid(); err != nil {
|
||||
return objInfo, InvalidArgument{Bucket: bucket, Object: object, Err: err}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user