From 53cf110c4eb5c697594b496642ac3f2a83de0516 Mon Sep 17 00:00:00 2001 From: mattl-netflix <63665634+mattl-netflix@users.noreply.github.com> Date: Mon, 13 Jun 2022 08:06:30 -0700 Subject: [PATCH] Remove dependency on whenAllComplete method which is not supported in 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) --- .../src/main/java/com/netflix/priam/aws/S3FileSystem.java | 7 ++----- .../java/com/netflix/priam/backup/IncrementalBackup.java | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/priam/src/main/java/com/netflix/priam/aws/S3FileSystem.java b/priam/src/main/java/com/netflix/priam/aws/S3FileSystem.java index ce597c13e..67aaf747e 100644 --- a/priam/src/main/java/com/netflix/priam/aws/S3FileSystem.java +++ b/priam/src/main/java/com/netflix/priam/aws/S3FileSystem.java @@ -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(1000, 10000, 5) { @Override diff --git a/priam/src/main/java/com/netflix/priam/backup/IncrementalBackup.java b/priam/src/main/java/com/netflix/priam/backup/IncrementalBackup.java index ffe1dbabe..b9a112e59 100644 --- a/priam/src/main/java/com/netflix/priam/backup/IncrementalBackup.java +++ b/priam/src/main/java/com/netflix/priam/backup/IncrementalBackup.java @@ -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; @@ -127,6 +125,8 @@ protected void processColumnFamily(File backupDir) throws Exception { // upload SSTables and components ImmutableList> futures = uploadAndDeleteAllFiles(backupDir, fileType, config.enableAsyncIncremental()); - Futures.whenAllComplete(futures).call(() -> null, MoreExecutors.directExecutor()); + for (ListenableFuture future : futures) { + future.get(); + } } }