Skip to content

Commit 9a97865

Browse files
author
Duc Hieu Pham
committed
Fix a bug in PutCloudObject when using transfer manager
1 parent c210122 commit 9a97865

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cloud/aws/aws_s3.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,9 @@ Status S3StorageProvider::DoPutCloudObject(const std::string& local_file,
864864
const std::string& object_path,
865865
uint64_t file_size) {
866866
if (s3client_->HasTransferManager()) {
867-
auto handle =
868-
s3client_->UploadFile(ToAwsString(local_file), ToAwsString(bucket_name),
869-
ToAwsString(object_path), file_size);
867+
auto handle = s3client_->UploadFile(ToAwsString(bucket_name),
868+
ToAwsString(object_path),
869+
ToAwsString(local_file), file_size);
870870
if (handle->GetStatus() != Aws::Transfer::TransferStatus::COMPLETED) {
871871
auto error = handle->GetLastError();
872872
std::string errmsg(error.GetMessage().c_str(), error.GetMessage().size());

cloud/db_cloud_test.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class CloudTest : public testing::Test {
118118

119119
void CreateAwsEnv() {
120120
CloudEnv* aenv;
121+
cloud_env_options_.use_aws_transfer_manager = true;
121122
ASSERT_OK(CloudEnv::NewAwsEnv(base_env_, cloud_env_options_,
122123
options_.info_log, &aenv));
123124
// To catch any possible file deletion bugs, we set file deletion delay to

0 commit comments

Comments
 (0)