airborne12 commented on code in PR #59011:
URL: https://github.com/apache/doris/pull/59011#discussion_r2641690278
##########
be/src/olap/rowset/segment_v2/index_file_writer.cpp:
##########
@@ -224,14 +224,31 @@ Status IndexFileWriter::close() {
err.what());
}
}
- LOG_INFO("IndexFileWriter closing, enable_write_index_searcher_cache: {}",
+ return Status::OK();
+}
+
+Status IndexFileWriter::wait_close() {
+ DCHECK(_closed) << debug_string();
+ if (_indices_dirs.empty()) {
+ // An empty file must still be created even if there are no indexes to
write
+ if (dynamic_cast<io::StreamSinkFileWriter*>(_idx_v2_writer.get()) !=
nullptr ||
+ dynamic_cast<io::S3FileWriter*>(_idx_v2_writer.get()) != nullptr ||
+ dynamic_cast<io::PackedFileWriter*>(_idx_v2_writer.get()) !=
nullptr) {
+ return _idx_v2_writer->close(false);
+ }
+ return Status::OK();
+ }
+ if (_idx_v2_writer != nullptr && _idx_v2_writer->state() !=
io::FileWriter::State::CLOSED) {
+ RETURN_IF_ERROR(_idx_v2_writer->close(false));
+ }
+ LOG_INFO("IndexFileWriter wait_close, enable_write_index_searcher_cache:
{}",
config::enable_write_index_searcher_cache);
Status st = Status::OK();
if (config::enable_write_index_searcher_cache) {
st = add_into_searcher_cache();
}
_indices_dirs.clear();
- return st;
+ return Status::OK();
Review Comment:
return st
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]