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

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit fae7a395de7961bd8907a4b0208d8b9328191c89
Author: plat1ko <platonekos...@gmail.com>
AuthorDate: Wed Jan 10 10:31:40 2024 +0800

    [Bug](FS) Fix S3FileSystem::file_size_impl #29720
---
 be/src/io/fs/s3_file_system.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/be/src/io/fs/s3_file_system.cpp b/be/src/io/fs/s3_file_system.cpp
index c7d4e07fd1e..77f303ffdc0 100644
--- a/be/src/io/fs/s3_file_system.cpp
+++ b/be/src/io/fs/s3_file_system.cpp
@@ -299,11 +299,12 @@ Status S3FileSystem::file_size_impl(const Path& file, 
int64_t* file_size) const
 
     auto outcome = client->HeadObject(request);
     s3_bvar::s3_head_total << 1;
-    if (outcome.IsSuccess()) {
-        *file_size = outcome.GetResult().GetContentLength();
+    if (!outcome.IsSuccess()) {
         return s3fs_error(outcome.GetError(),
                           fmt::format("failed to get file size {}", 
full_path(key)));
     }
+
+    *file_size = outcome.GetResult().GetContentLength();
     return Status::OK();
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to