|
|
@ -414,7 +414,7 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s |
|
|
|
er.deleteObjectVersion(ctx, bucket, object, 1, FileInfo{ |
|
|
|
er.deleteObjectVersion(ctx, bucket, object, 1, FileInfo{ |
|
|
|
Name: object, |
|
|
|
Name: object, |
|
|
|
VersionID: opts.VersionID, |
|
|
|
VersionID: opts.VersionID, |
|
|
|
}) |
|
|
|
}, false) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -800,7 +800,7 @@ func (er erasureObjects) putObject(ctx context.Context, bucket string, object st |
|
|
|
return fi.ToObjectInfo(bucket, object), nil |
|
|
|
return fi.ToObjectInfo(bucket, object), nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (er erasureObjects) deleteObjectVersion(ctx context.Context, bucket, object string, writeQuorum int, fi FileInfo) error { |
|
|
|
func (er erasureObjects) deleteObjectVersion(ctx context.Context, bucket, object string, writeQuorum int, fi FileInfo, forceDelMarker bool) error { |
|
|
|
defer ObjectPathUpdated(pathJoin(bucket, object)) |
|
|
|
defer ObjectPathUpdated(pathJoin(bucket, object)) |
|
|
|
disks := er.getDisks() |
|
|
|
disks := er.getDisks() |
|
|
|
g := errgroup.WithNErrs(len(disks)) |
|
|
|
g := errgroup.WithNErrs(len(disks)) |
|
|
@ -810,7 +810,7 @@ func (er erasureObjects) deleteObjectVersion(ctx context.Context, bucket, object |
|
|
|
if disks[index] == nil { |
|
|
|
if disks[index] == nil { |
|
|
|
return errDiskNotFound |
|
|
|
return errDiskNotFound |
|
|
|
} |
|
|
|
} |
|
|
|
return disks[index].DeleteVersion(ctx, bucket, object, fi) |
|
|
|
return disks[index].DeleteVersion(ctx, bucket, object, fi, forceDelMarker) |
|
|
|
}, index) |
|
|
|
}, index) |
|
|
|
} |
|
|
|
} |
|
|
|
// return errors if any during deletion
|
|
|
|
// return errors if any during deletion
|
|
|
@ -1098,7 +1098,7 @@ func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string |
|
|
|
// version as delete marker
|
|
|
|
// version as delete marker
|
|
|
|
// Add delete marker, since we don't have any version specified explicitly.
|
|
|
|
// Add delete marker, since we don't have any version specified explicitly.
|
|
|
|
// Or if a particular version id needs to be replicated.
|
|
|
|
// Or if a particular version id needs to be replicated.
|
|
|
|
if err = er.deleteObjectVersion(ctx, bucket, object, writeQuorum, fi); err != nil { |
|
|
|
if err = er.deleteObjectVersion(ctx, bucket, object, writeQuorum, fi, opts.DeleteMarker); err != nil { |
|
|
|
return objInfo, toObjectErr(err, bucket, object) |
|
|
|
return objInfo, toObjectErr(err, bucket, object) |
|
|
|
} |
|
|
|
} |
|
|
|
return fi.ToObjectInfo(bucket, object), nil |
|
|
|
return fi.ToObjectInfo(bucket, object), nil |
|
|
@ -1115,7 +1115,7 @@ func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string |
|
|
|
DeleteMarkerReplicationStatus: opts.DeleteMarkerReplicationStatus, |
|
|
|
DeleteMarkerReplicationStatus: opts.DeleteMarkerReplicationStatus, |
|
|
|
VersionPurgeStatus: opts.VersionPurgeStatus, |
|
|
|
VersionPurgeStatus: opts.VersionPurgeStatus, |
|
|
|
TransitionStatus: opts.TransitionStatus, |
|
|
|
TransitionStatus: opts.TransitionStatus, |
|
|
|
}); err != nil { |
|
|
|
}, opts.DeleteMarker); err != nil { |
|
|
|
return objInfo, toObjectErr(err, bucket, object) |
|
|
|
return objInfo, toObjectErr(err, bucket, object) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|