mirror of
https://github.com/minio/minio.git
synced 2025-04-19 10:07:30 -04:00
Calculate correct object size while replication (#19888)
It was missing in case of `replicateObject` but was present for `replicateAll` already Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
This commit is contained in:
parent
0fbb945e13
commit
2f6e03fb60
@ -1227,7 +1227,12 @@ func (ri ReplicateObjectInfo) replicateObject(ctx context.Context, objectAPI Obj
|
|||||||
// make sure we have the latest metadata for metrics calculation
|
// make sure we have the latest metadata for metrics calculation
|
||||||
rinfo.PrevReplicationStatus = objInfo.TargetReplicationStatus(tgt.ARN)
|
rinfo.PrevReplicationStatus = objInfo.TargetReplicationStatus(tgt.ARN)
|
||||||
|
|
||||||
size, err := objInfo.GetActualSize()
|
// Set the encrypted size for SSE-C objects
|
||||||
|
var size int64
|
||||||
|
if crypto.SSEC.IsEncrypted(objInfo.UserDefined) {
|
||||||
|
size = objInfo.Size
|
||||||
|
} else {
|
||||||
|
size, err = objInfo.GetActualSize()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
replLogIf(ctx, err)
|
replLogIf(ctx, err)
|
||||||
sendEvent(eventArgs{
|
sendEvent(eventArgs{
|
||||||
@ -1239,6 +1244,7 @@ func (ri ReplicateObjectInfo) replicateObject(ctx context.Context, objectAPI Obj
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if tgt.Bucket == "" {
|
if tgt.Bucket == "" {
|
||||||
replLogIf(ctx, fmt.Errorf("unable to replicate object %s(%s), bucket is empty for target %s", objInfo.Name, objInfo.VersionID, tgt.EndpointURL()))
|
replLogIf(ctx, fmt.Errorf("unable to replicate object %s(%s), bucket is empty for target %s", objInfo.Name, objInfo.VersionID, tgt.EndpointURL()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user