fix: Add support for preserving mtime for replication (#9995)

This PR is needed for bucket replication support
This commit is contained in:
Harshavardhana
2020-07-08 17:36:56 -07:00
committed by GitHub
parent 6136a963c8
commit 2743d4ca87
14 changed files with 358 additions and 266 deletions
+5 -3
View File
@@ -698,9 +698,6 @@ func (er erasureObjects) putObject(ctx context.Context, bucket string, object st
})
}
// Save additional erasureMetadata.
modTime := UTCNow()
opts.UserDefined["etag"] = r.MD5CurrentHexString()
// Guess content-type from the extension if possible.
@@ -708,6 +705,11 @@ func (er erasureObjects) putObject(ctx context.Context, bucket string, object st
opts.UserDefined["content-type"] = mimedb.TypeByExtension(path.Ext(object))
}
modTime := opts.MTime
if opts.MTime.IsZero() {
modTime = UTCNow()
}
// Fill all the necessary metadata.
// Update `xl.meta` content on each disks.
for index := range partsMetadata {