kangpinghuang commented on a change in pull request #1159: Check _empty when convert old files or make snapshots URL: https://github.com/apache/incubator-doris/pull/1159#discussion_r284051285
########## File path: be/src/olap/olap_snapshot_converter.cpp ########## @@ -497,4 +502,21 @@ OLAPStatus OlapSnapshotConverter::save(const string& file_path, const OLAPHeader return OLAP_SUCCESS; } +void OlapSnapshotConverter::_modify_old_segment_group_id(RowsetMetaPB& rowset_meta) { + if (!rowset_meta.has_alpha_rowset_extra_meta_pb()) { + return; + } + AlphaRowsetExtraMetaPB* alpha_rowset_extra_meta_pb = rowset_meta.mutable_alpha_rowset_extra_meta_pb(); + for (auto& segment_group_pb : alpha_rowset_extra_meta_pb->segment_groups()) { + if (segment_group_pb.segment_group_id() == -1) { + // check if segment groups size == 1 + if (alpha_rowset_extra_meta_pb->segment_groups().size() != 1) { + LOG(FATAL) << "the rowset has a segment group's id == -1 but it contains more than one segment group" + << " it should not happen"; + } + (const_cast<SegmentGroupPB&>(segment_group_pb)).set_segment_group_id(0); Review comment: do you rename the old file name to new file name when segment group id is -1? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org