zzzxl1993 commented on code in PR #44205:
URL: https://github.com/apache/doris/pull/44205#discussion_r1851309796


##########
be/src/olap/rowset/segment_v2/inverted_index_file_writer.cpp:
##########
@@ -326,22 +320,18 @@ Status InvertedIndexFileWriter::write_v2() {
         _total_file_size = compound_file_output->getFilePointer();
         _file_info.set_index_size(_total_file_size);
     } catch (CLuceneError& err) {
-        eptr = std::current_exception();
+        error_context.eptr = std::current_exception();
         auto index_path = 
InvertedIndexDescriptor::get_index_file_path_v2(_index_path_prefix);
-        err_msg = "CLuceneError occur when close idx file " + index_path +
-                  " error msg: " + err.what();
-    }
-
-    // Close and clean up
-    finalize_output_dir(out_dir);
-    if (compound_file_output) {
-        compound_file_output->close();
-    }
-
-    if (eptr) {
-        LOG(ERROR) << err_msg;
-        return Status::Error<ErrorCode::INVERTED_INDEX_CLUCENE_ERROR>(err_msg);
+        error_context.err_msg.append("CLuceneError occur when close idx file: 
");
+        error_context.err_msg.append(index_path);
+        error_context.err_msg.append(", error msg: ");
+        error_context.err_msg.append(err.what());
+        LOG(ERROR) << error_context.err_msg;
     }
+    FINALLY_ON_ERROR({

Review Comment:
   done



##########
be/src/olap/rowset/segment_v2/inverted_index_file_writer.cpp:
##########
@@ -443,9 +428,9 @@ InvertedIndexFileWriter::create_output_stream_v1(int64_t 
index_id,
                         "output is nullptr.";
         _CLTHROWA(CL_ERR_IO, "Create CompoundDirectory output error");
     }
-
     std::unique_ptr<lucene::store::IndexOutput> output(out);
-    return {out_dir, std::move(output)};
+
+    return std::make_pair(std::move(out_dir_ptr), std::move(output));

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to