w41ter commented on code in PR #38306: URL: https://github.com/apache/doris/pull/38306#discussion_r1690722464
########## cloud/src/recycler/recycler.cpp: ########## @@ -1273,17 +1274,26 @@ int InstanceRecycler::delete_rowset_data(const doris::RowsetMetaCloudPB& rs_meta const auto& rowset_id = rs_meta_pb.rowset_id_v2(); int64_t tablet_id = rs_meta_pb.tablet_id(); // process inverted indexes - std::vector<int64_t> index_ids; + std::vector<std::pair<int64_t, std::string>> index_ids; index_ids.reserve(rs_meta_pb.tablet_schema().index_size()); for (auto& i : rs_meta_pb.tablet_schema().index()) { - index_ids.push_back(i.index_id()); + index_ids.push_back(std::make_pair(i.index_id(), i.index_suffix_name())); } std::vector<std::string> file_paths; - file_paths.reserve(num_segments * (1 + index_ids.size())); + auto tablet_schema = rs_meta_pb.tablet_schema(); for (int64_t i = 0; i < num_segments; ++i) { file_paths.push_back(segment_path(tablet_id, rowset_id, i)); - for (int64_t index_id : index_ids) { - file_paths.push_back(inverted_index_path(tablet_id, rowset_id, i, index_id)); + if (tablet_schema.has_inverted_index_storage_format()) { + if (tablet_schema.inverted_index_storage_format() == InvertedIndexStorageFormatPB::V1) { + for (const auto& index_id : index_ids) { + file_paths.push_back(inverted_index_path_v1(tablet_id, rowset_id, i, + index_id.first, index_id.second)); + } + } else { + if (!index_ids.empty()) { + file_paths.push_back(inverted_index_path_v2(tablet_id, rowset_id, i)); + } Review Comment: ```suggestion } else if (!index_ids.empty()) { file_paths.push_back(inverted_index_path_v2(tablet_id, rowset_id, i)); ``` ########## cloud/src/recycler/recycler.cpp: ########## @@ -1352,11 +1369,20 @@ int InstanceRecycler::delete_rowset_data(const std::vector<doris::RowsetMetaClou ret = -1; continue; } + index_format = index_info.first; + index_ids = std::move(index_info.second); } for (int64_t i = 0; i < num_segments; ++i) { file_paths.push_back(segment_path(tablet_id, rowset_id, i)); - for (int64_t index_id : index_ids) { - file_paths.push_back(inverted_index_path(tablet_id, rowset_id, i, index_id)); + if (index_format == InvertedIndexStorageFormatPB::V1) { + for (const auto& index_id : index_ids) { + file_paths.push_back(inverted_index_path_v1(tablet_id, rowset_id, i, + index_id.first, index_id.second)); + } + } else { + if (!index_ids.empty()) { + file_paths.push_back(inverted_index_path_v2(tablet_id, rowset_id, i)); + } Review Comment: ```suggestion } else if (!index_ids.empty()) { file_paths.push_back(inverted_index_path_v2(tablet_id, rowset_id, i)); ``` -- 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