You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/10/27 06:59:33 UTC

[doris] branch branch-1.1-lts updated: [fix](export)(outfile) fix bug that export may fail when writing SUCCESS file (#13709)

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

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


The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
     new e413ac0562 [fix](export)(outfile) fix bug that export may fail when writing SUCCESS file (#13709)
e413ac0562 is described below

commit e413ac0562d12db2ca3da3178c230f5831e7a7de
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Thu Oct 27 14:59:28 2022 +0800

    [fix](export)(outfile) fix bug that export may fail when writing SUCCESS file (#13709)
    
    cherry-pick #13574
---
 be/src/vec/runtime/vfile_result_writer.cpp | 9 +++++++--
 be/src/vec/runtime/vfile_result_writer.h   | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/be/src/vec/runtime/vfile_result_writer.cpp b/be/src/vec/runtime/vfile_result_writer.cpp
index 144908a6df..ba9cd10802 100644
--- a/be/src/vec/runtime/vfile_result_writer.cpp
+++ b/be/src/vec/runtime/vfile_result_writer.cpp
@@ -81,7 +81,8 @@ Status VFileResultWriter::_create_success_file() {
     std::string file_name;
     RETURN_IF_ERROR(_get_success_file_name(&file_name));
     RETURN_IF_ERROR(_create_file_writer(file_name));
-    return _close_file_writer(true);
+    // set only close to true to avoid dead loop
+    return _close_file_writer(true, true);
 }
 
 Status VFileResultWriter::_get_success_file_name(std::string* file_name) {
@@ -358,7 +359,7 @@ Status VFileResultWriter::_create_new_file_if_exceed_size() {
     return Status::OK();
 }
 
-Status VFileResultWriter::_close_file_writer(bool done) {
+Status VFileResultWriter::_close_file_writer(bool done, bool only_close) {
     if (_vparquet_writer) {
         _vparquet_writer->close();
         COUNTER_UPDATE(_written_data_bytes, _current_written_bytes);
@@ -367,6 +368,10 @@ Status VFileResultWriter::_close_file_writer(bool done) {
         _file_writer_impl->close();
     }
 
+    if (only_close) {
+        return Status::OK();
+    }
+
     if (!done) {
         // not finished, create new file writer for next file
         RETURN_IF_ERROR(_create_next_file_writer());
diff --git a/be/src/vec/runtime/vfile_result_writer.h b/be/src/vec/runtime/vfile_result_writer.h
index a3a4e59a17..85c00eee10 100644
--- a/be/src/vec/runtime/vfile_result_writer.h
+++ b/be/src/vec/runtime/vfile_result_writer.h
@@ -67,7 +67,7 @@ private:
     std::string _file_format_to_name();
     // close file writer, and if !done, it will create new writer for next file.
     // if only_close is true, this method will just close the file writer and return.
-    Status _close_file_writer(bool done);
+    Status _close_file_writer(bool done, bool only_close = false);
     // create a new file if current file size exceed limit
     Status _create_new_file_if_exceed_size();
     // send the final statistic result


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