SWJTU-ZhangLei commented on code in PR #38243: URL: https://github.com/apache/doris/pull/38243#discussion_r1732711244
########## cloud/src/meta-service/meta_service_txn.cpp: ########## @@ -974,353 +1361,476 @@ void commit_txn_immediately( LOG(WARNING) << msg << " err=" << err << " txn_id=" << txn_id; return; } - if (!tablet_ids[tablet_id].ParseFromString(tablet_idx_values[i].value())) [[unlikely]] { + if (!(*tablet_ids)[tablet_id].ParseFromString(tablet_idx_values[i].value())) [[unlikely]] { code = MetaServiceCode::PROTOBUF_PARSE_ERR; ss << "malformed tablet index value tablet_id=" << tablet_id << " txn_id=" << txn_id; msg = ss.str(); LOG(WARNING) << msg; return; } - table_id_tablet_ids[tablet_ids[tablet_id].table_id()].push_back(tablet_id); + if (!(*tablet_ids)[tablet_id].has_db_id()) { + *need_repair_tablet_idx = true; + } + (*table_id_tablet_ids)[(*tablet_ids)[tablet_id].table_id()].push_back(tablet_id); VLOG_DEBUG << "tablet_id:" << tablet_id - << " value:" << tablet_ids[tablet_id].ShortDebugString(); + << " value:" << (*tablet_ids)[tablet_id].ShortDebugString(); } tablet_idx_keys.clear(); tablet_idx_values.clear(); +} - // {table/partition} -> version - std::unordered_map<std::string, uint64_t> new_versions; - std::vector<std::string> version_keys; +void repair_tablet_index( Review Comment: > add comment what does it do and why done -- 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