skip redundant decompression of compressed needles during replication

doUploadData decompressed a compressed input only to report the clear-data length on UploadResult.Size, which both replication callers discard. Skip the decompress when IsReplication.
This commit is contained in:
Chris Lu
2026-06-13 13:11:35 -07:00
parent 2118d85456
commit b441f8c4fa
+2 -2
View File
@@ -312,8 +312,8 @@ func (uploader *Uploader) doUploadData(ctx context.Context, data []byte, option
contentIsGzipped = true
}
}
} else if option.IsInputCompressed {
// just to get the clear data length
} else if option.IsInputCompressed && !option.IsReplication {
// decompress only to report the clear data length; replication discards the result, so skip it
clearData, err = util.DecompressData(data)
if err == nil {
clearDataLen = len(clearData)