mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-06-13 23:36:45 +03:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user