mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
fix: find current location of object multi-zones (#9840)
PutObject on multiple-zone with versioning would not overwrite the correct location of the object if the object has delete marker, leading to duplicate objects on two zones. This PR fixes by adding affinity towards delete marker when GetObjectInfo() returns error, use the zone index which has the delete marker.
This commit is contained in:
@@ -401,11 +401,12 @@ func (er erasureObjects) getObjectInfo(ctx context.Context, bucket, object strin
|
||||
}
|
||||
|
||||
if fi.Deleted {
|
||||
objInfo = fi.ToObjectInfo(bucket, object)
|
||||
if opts.VersionID == "" {
|
||||
return objInfo, toObjectErr(errFileNotFound, bucket, object)
|
||||
}
|
||||
// Make sure to return object info to provide extra information.
|
||||
return fi.ToObjectInfo(bucket, object), toObjectErr(errMethodNotAllowed, bucket, object)
|
||||
return objInfo, toObjectErr(errMethodNotAllowed, bucket, object)
|
||||
}
|
||||
|
||||
return fi.ToObjectInfo(bucket, object), nil
|
||||
|
||||
Reference in New Issue
Block a user