mirror of
https://github.com/minio/minio.git
synced 2025-01-26 22:23:15 -05:00
fix tagging overwrite during resync (#20525)
This commit is contained in:
parent
28322124e2
commit
1bc6681176
@ -1522,7 +1522,7 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
|
|||||||
if !srcTimestamp.IsZero() {
|
if !srcTimestamp.IsZero() {
|
||||||
ondiskTimestamp, err := time.Parse(time.RFC3339Nano, lastTaggingTimestamp)
|
ondiskTimestamp, err := time.Parse(time.RFC3339Nano, lastTaggingTimestamp)
|
||||||
// update tagging metadata only if replica timestamp is newer than what's on disk
|
// update tagging metadata only if replica timestamp is newer than what's on disk
|
||||||
if err != nil || (err == nil && ondiskTimestamp.Before(srcTimestamp)) {
|
if err != nil || (err == nil && !ondiskTimestamp.After(srcTimestamp)) {
|
||||||
srcInfo.UserDefined[ReservedMetadataPrefixLower+TaggingTimestamp] = srcTimestamp.UTC().Format(time.RFC3339Nano)
|
srcInfo.UserDefined[ReservedMetadataPrefixLower+TaggingTimestamp] = srcTimestamp.UTC().Format(time.RFC3339Nano)
|
||||||
srcInfo.UserDefined[xhttp.AmzObjectTagging] = objTags
|
srcInfo.UserDefined[xhttp.AmzObjectTagging] = objTags
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user