gaodayue commented on a change in pull request #1590: Implement BetaRowsetWriter
URL: https://github.com/apache/incubator-doris/pull/1590#discussion_r312769880
##########
File path: be/src/olap/rowset/segment_group.cpp
##########
@@ -902,23 +863,27 @@ OLAPStatus SegmentGroup::link_segments_to_path(const
std::string& dest_path, int
for (int segment_id = 0; segment_id < _num_segments; segment_id++) {
std::string data_file_name = _construct_file_name(rowset_id,
segment_id, ".dat");
std::string new_data_file_path = dest_path + "/" + data_file_name;
- if (!check_dir_existed(new_data_file_path)) {
- std::string origin_data_file_path =
construct_data_file_path(_rowset_path_prefix, segment_id);
- if (link(origin_data_file_path.c_str(),
new_data_file_path.c_str()) != 0) {
- LOG(WARNING) << "fail to create hard link. from=" <<
origin_data_file_path
- << ", to=" << new_data_file_path << ", error=" <<
strerror(errno);
- return OLAP_ERR_OS_ERROR;
- }
+ if (check_dir_existed(new_data_file_path)) {
Review comment:
Yeah, the original implementation is inconsistent in that `make_snapshot`
reports OLAP_ERR_FILE_ALREADY_EXIST when target file exists while
`link_segments_to_path` ignores already existed files. I think for hard link
purpose, ignoring existed files is the right way to go.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]