This is an automated email from the ASF dual-hosted git repository.

pengxiangyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 2fcdd766bd [fix](remote) fix be crash while write data to s3 in debug 
mode (#15047)
2fcdd766bd is described below

commit 2fcdd766bd819a60e426c077d62b8247cd94e21c
Author: zxealous <[email protected]>
AuthorDate: Thu Dec 15 19:56:35 2022 +0800

    [fix](remote) fix be crash while write data to s3 in debug mode (#15047)
---
 be/src/io/fs/s3_file_writer.cpp | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/be/src/io/fs/s3_file_writer.cpp b/be/src/io/fs/s3_file_writer.cpp
index 0a5848726a..9142a18faf 100644
--- a/be/src/io/fs/s3_file_writer.cpp
+++ b/be/src/io/fs/s3_file_writer.cpp
@@ -167,16 +167,22 @@ Status S3FileWriter::_upload_part() {
     UploadPartOutcome upload_part_outcome = upload_part_callable.get();
     _reset_stream();
     if (!upload_part_outcome.IsSuccess()) {
-        return Status::IOError(
-                "failed to upload part (endpoint={}, bucket={}, key={}, 
part_num = {}): {}",
-                _s3_conf.endpoint, _s3_conf.bucket, _path.native(), 
_cur_part_num,
-                upload_part_outcome.GetError().GetMessage());
+        LOG(ERROR) << "failed to upload part (endpoint=" << _s3_conf.endpoint
+                   << ", bucket=" << _s3_conf.bucket << ", key=" << 
_path.native()
+                   << ", part_num=" << _cur_part_num
+                   << ") Error msg: " << 
upload_part_outcome.GetError().GetMessage();
+        return Status::IOError("failed to upload part.");
     }
 
     std::shared_ptr<CompletedPart> completed_part = 
std::make_shared<CompletedPart>();
     completed_part->SetPartNumber(_cur_part_num);
     auto etag = upload_part_outcome.GetResult().GetETag();
-    DCHECK(etag.empty());
+    if (etag.empty()) {
+        LOG(ERROR) << "upload part success but etag is empty (endpoint=" << 
_s3_conf.endpoint
+                   << ", bucket=" << _s3_conf.bucket << ", key=" << 
_path.native()
+                   << ", part_num=" << _cur_part_num << ")";
+        return Status::IOError("upload part success but etag is empty.");
+    }
     completed_part->SetETag(etag);
     _completed_parts.emplace_back(completed_part);
     return Status::OK();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to