Skip to content

Commit abc4ac2

Browse files
committed
sstable: avoid double compression with noop compressor
Add a check for NoCompressionIndicator to avoid compressing twice with the noop compressor.
1 parent a7c0954 commit abc4ac2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sstable/block/compression.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func CompressAndChecksumWithCompressor(
230230
// Compress the buffer, discarding the result if the improvement isn't at
231231
// least 12.5%.
232232
algo, buf := compressor.Compress(buf, blockData)
233-
if len(buf) >= len(blockData)-len(blockData)/8 {
233+
if len(buf) >= len(blockData)-len(blockData)/8 && algo != NoCompressionIndicator {
234234
algo, buf = (noopCompressor{}).Compress(buf, blockData)
235235
}
236236

0 commit comments

Comments
 (0)