mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #64714 from ClickHouse/s3jank
Check for missing Upload ID in CreateMultipartUpload reply
This commit is contained in:
commit
a838adc0bf
@ -149,16 +149,18 @@ namespace
|
|||||||
dest_bucket, dest_key, /* local_path_ */ {}, /* data_size */ 0,
|
dest_bucket, dest_key, /* local_path_ */ {}, /* data_size */ 0,
|
||||||
outcome.IsSuccess() ? nullptr : &outcome.GetError());
|
outcome.IsSuccess() ? nullptr : &outcome.GetError());
|
||||||
|
|
||||||
if (outcome.IsSuccess())
|
if (!outcome.IsSuccess())
|
||||||
{
|
|
||||||
multipart_upload_id = outcome.GetResult().GetUploadId();
|
|
||||||
LOG_TRACE(log, "Multipart upload has created. Bucket: {}, Key: {}, Upload id: {}", dest_bucket, dest_key, multipart_upload_id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
ProfileEvents::increment(ProfileEvents::WriteBufferFromS3RequestsErrors, 1);
|
ProfileEvents::increment(ProfileEvents::WriteBufferFromS3RequestsErrors, 1);
|
||||||
throw S3Exception(outcome.GetError().GetMessage(), outcome.GetError().GetErrorType());
|
throw S3Exception(outcome.GetError().GetMessage(), outcome.GetError().GetErrorType());
|
||||||
}
|
}
|
||||||
|
multipart_upload_id = outcome.GetResult().GetUploadId();
|
||||||
|
if (multipart_upload_id.empty())
|
||||||
|
{
|
||||||
|
ProfileEvents::increment(ProfileEvents::WriteBufferFromS3RequestsErrors, 1);
|
||||||
|
throw Exception(ErrorCodes::S3_ERROR, "Invalid CreateMultipartUpload result: missing UploadId.");
|
||||||
|
}
|
||||||
|
LOG_TRACE(log, "Multipart upload was created. Bucket: {}, Key: {}, Upload id: {}", dest_bucket, dest_key, multipart_upload_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void completeMultipartUpload()
|
void completeMultipartUpload()
|
||||||
|
@ -413,7 +413,13 @@ void WriteBufferFromS3::createMultipartUpload()
|
|||||||
|
|
||||||
multipart_upload_id = outcome.GetResult().GetUploadId();
|
multipart_upload_id = outcome.GetResult().GetUploadId();
|
||||||
|
|
||||||
LOG_TRACE(limitedLog, "Multipart upload has created. {}", getShortLogDetails());
|
if (multipart_upload_id.empty())
|
||||||
|
{
|
||||||
|
ProfileEvents::increment(ProfileEvents::WriteBufferFromS3RequestsErrors, 1);
|
||||||
|
throw Exception(ErrorCodes::S3_ERROR, "Invalid CreateMultipartUpload result: missing UploadId.");
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_TRACE(limitedLog, "Multipart upload was created. {}", getShortLogDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteBufferFromS3::abortMultipartUpload()
|
void WriteBufferFromS3::abortMultipartUpload()
|
||||||
|
Loading…
Reference in New Issue
Block a user