liaoxin01 commented on code in PR #48866: URL: https://github.com/apache/doris/pull/48866#discussion_r1997621894
########## be/src/olap/delta_writer.cpp: ########## @@ -231,7 +231,24 @@ int64_t BaseDeltaWriter::mem_consumption(MemType mem) { return _memtable_writer->mem_consumption(mem); } -void DeltaWriter::_request_slave_tablet_pull_rowset(const PNodeInfo& node_info) { +Status DeltaWriter::_safe_get_file_size(const std::string& file_path, int64_t* file_size) { + CHECK(file_size != nullptr) << "Null output parameter in safe_get_file_size"; + + try { + if (!std::filesystem::exists(file_path)) { Review Comment: There is no need to check if the file exists. If the file does not exist, the file_size function will throw an exception. ########## be/src/olap/delta_writer.cpp: ########## @@ -281,7 +299,9 @@ void DeltaWriter::_request_slave_tablet_pull_rowset(const PNodeInfo& node_info) for (int segment_id = 0; segment_id < cur_rowset->rowset_meta()->num_segments(); segment_id++) { auto seg_path = local_segment_path(tablet_path, cur_rowset->rowset_id().to_string(), segment_id); - int64_t segment_size = std::filesystem::file_size(seg_path); + int64_t segment_size = 0; + RETURN_IF_ERROR(safe_get_file_size(seg_path, &segment_size)); Review Comment: ```suggestion RETURN_IF_ERROR(_safe_get_file_size(seg_path, &segment_size)); ``` compile error. -- 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