mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Don't add free-version on restore-object (#14340)
This commit is contained in:
parent
af8f563ed3
commit
5a0c0079a1
@ -477,6 +477,18 @@ func (fi *FileInfo) TierFreeVersion() bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
// IsRestoreObjReq returns true if fi corresponds to a RestoreObject request.
|
||||
func (fi *FileInfo) IsRestoreObjReq() bool {
|
||||
if restoreHdr, ok := fi.Metadata[xhttp.AmzRestore]; ok {
|
||||
if restoreStatus, err := parseRestoreObjStatus(restoreHdr); err == nil {
|
||||
if !restoreStatus.Ongoing() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// VersionPurgeStatus returns overall version purge status for this object version across targets
|
||||
func (fi *FileInfo) VersionPurgeStatus() VersionPurgeStatusType {
|
||||
return fi.ReplicationState.CompositeVersionPurgeStatus()
|
||||
|
@ -2241,8 +2241,14 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, f
|
||||
// suspended or disabled on this bucket. RenameData will replace
|
||||
// the 'null' version. We add a free-version to track its tiered
|
||||
// content for asynchronous deletion.
|
||||
if !fi.IsRestoreObjReq() {
|
||||
// Note: Restore object request reuses PutObject/Multipart
|
||||
// upload to copy back its data from the remote tier. This
|
||||
// doesn't replace the existing version, so we don't need to add
|
||||
// a free-version.
|
||||
xlMeta.AddFreeVersion(fi)
|
||||
}
|
||||
}
|
||||
|
||||
// indicates if RenameData() is called by healing.
|
||||
// healing doesn't preserve the dataDir as 'legacy'
|
||||
|
Loading…
Reference in New Issue
Block a user