Skip to content

Commit

Permalink
Remove dependency on whenAllComplete method which is not supported in…
Browse files Browse the repository at this point in the history
… the maximum allowed version of Guava in 2.1. Also, cease attempting to upload empty files. To adhere to our original logic, they should be deleted before we reach that point. (#987)
  • Loading branch information
mattl-netflix authored Jun 13, 2022
1 parent 5d0b3a9 commit 53cf110
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions priam/src/main/java/com/netflix/priam/aws/S3FileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,8 @@ protected long uploadFileImpl(AbstractBackupPath path, Instant target)
File localFile = Paths.get(path.getBackupFile().getAbsolutePath()).toFile();
if (localFile.length() >= config.getBackupChunkSize()) return uploadMultipart(path, target);
byte[] chunk = getFileContents(path);
// C* snapshots may have empty files. That is probably unintentional.
if (chunk.length > 0) {
rateLimiter.acquire(chunk.length);
dynamicRateLimiter.acquire(path, target, chunk.length);
}
rateLimiter.acquire(chunk.length);
dynamicRateLimiter.acquire(path, target, chunk.length);
try {
new BoundedExponentialRetryCallable<PutObjectResult>(1000, 10000, 5) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
package com.netflix.priam.backup;

import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
Expand Down Expand Up @@ -127,6 +125,8 @@ protected void processColumnFamily(File backupDir) throws Exception {
// upload SSTables and components
ImmutableList<ListenableFuture<AbstractBackupPath>> futures =
uploadAndDeleteAllFiles(backupDir, fileType, config.enableAsyncIncremental());
Futures.whenAllComplete(futures).call(() -> null, MoreExecutors.directExecutor());
for (ListenableFuture<AbstractBackupPath> future : futures) {
future.get();
}
}
}

0 comments on commit 53cf110

Please sign in to comment.