Skip to content

Commit da4d8ae

Browse files
Only allow reusable ByteBuffers when not compressing. Snappy-compression doesn't work in that code path. (#1141)
1 parent 43f0d97 commit da4d8ae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

priam/src/main/java/com/netflix/priam/aws/S3FileSystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private Map<String, String> getFileMetadata(File file) {
138138

139139
private long uploadMultipart(AbstractBackupPath path, Instant target)
140140
throws BackupRestoreException {
141-
if (config.useReusableBufferForMultipartUploads()) {
141+
if (config.useReusableBufferForMultipartUploads() && path.getCompression() == CompressionType.NONE) {
142142
return uploadMultipartWithBuffers(path, target);
143143
} else {
144144
return uploadMultipartLegacy(path, target);
@@ -355,7 +355,7 @@ protected long uploadFileImpl(AbstractBackupPath path, Instant target)
355355
if (localFile.length() >= config.getBackupChunkSize())
356356
return uploadMultipart(path, target);
357357

358-
if (config.useReusableBufferForMultipartUploads()) {
358+
if (config.useReusableBufferForMultipartUploads() && path.getCompression() == CompressionType.NONE) {
359359
return uploadFileWithByteBuffer(path, target);
360360
} else {
361361
return uploadFileWithByteArray(path, target);

0 commit comments

Comments
 (0)