Skip to content

Commit

Permalink
Merge pull request #778 from arunagrawal84/hotfix
Browse files Browse the repository at this point in the history
Do not check existence of file if it is not SST_V2.
  • Loading branch information
arunagrawal-84 authored Feb 8, 2019
2 parents ebd1c28 + 1f53c5f commit 592d3f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
15 changes: 4 additions & 11 deletions priam/src/main/java/com/netflix/priam/aws/S3FileSystemBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package com.netflix.priam.aws;

import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.BucketLifecycleConfiguration;
import com.amazonaws.services.s3.model.BucketLifecycleConfiguration.Rule;
Expand Down Expand Up @@ -168,18 +167,12 @@ public boolean doesRemoteFileExist(Path remotePath) throws BackupRestoreExceptio
boolean exists = false;
try {
exists = s3Client.doesObjectExist(getShard(), remotePath.toString());
} catch (AmazonServiceException ase) {
// Amazon S3 rejected request
throw new BackupRestoreException(
"AmazonServiceException while checking existence of object: "
+ remotePath
+ ". Error: "
+ ase.getMessage());
} catch (AmazonClientException ace) {
} catch (AmazonClientException ex) {
// No point throwing this exception up.
logger.error(
"AmazonClientException: client encountered a serious internal problem while trying to communicate with S3",
ace.getMessage());
"Exception while checking existence of object: {}. Error: {}",
remotePath,
ex.getMessage());
}

return exists;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.netflix.priam.backup.AbstractBackupPath.BackupFileType;
import com.netflix.priam.config.IConfiguration;
import com.netflix.priam.merics.BackupMetrics;
import com.netflix.priam.notification.BackupEvent;
Expand Down Expand Up @@ -182,7 +183,7 @@ public void uploadFile(
long uploadedFileSize;

// Upload file if it not present at remote location.
if (!doesRemoteFileExist(remotePath)) {
if (path.getType() != BackupFileType.SST_V2 || !doesRemoteFileExist(remotePath)) {
uploadedFileSize =
new BoundedExponentialRetryCallable<Long>(500, 10000, retry) {
@Override
Expand Down

0 comments on commit 592d3f2

Please sign in to comment.