SWJTU-ZhangLei commented on code in PR #38243: URL: https://github.com/apache/doris/pull/38243#discussion_r1706546958
########## cloud/src/meta-service/meta_service_txn.cpp: ########## @@ -788,6 +788,164 @@ void update_tablet_stats(const StatsTabletKeyInfo& info, const TabletStats& stat txn->put(key, val); } } + +void convert_tmp_rowsets( + const std::string& instance_id, int64_t txn_id, std::shared_ptr<TxnKv> txn_kv, + MetaServiceCode& code, std::string& msg, int64_t db_id, + std::vector<std::pair<std::string, doris::RowsetMetaCloudPB>>& tmp_rowsets_meta, + std::unordered_map<int64_t, TabletIndexPB>& tablet_ids) { + std::stringstream ss; + std::unique_ptr<Transaction> txn; + TxnErrorCode err = txn_kv->create_txn(&txn); + if (err != TxnErrorCode::TXN_OK) { + code = cast_as<ErrCategory::CREATE>(err); + ss << "failed to create txn, txn_id=" << txn_id << " err=" << err; + msg = ss.str(); + LOG(WARNING) << msg; + return; + } + + // partition_id -> VersionPB + std::unordered_map<int64_t, VersionPB> partition_versions; + // tablet_id -> stats + std::unordered_map<int64_t, TabletStats> tablet_stats; + + for (auto& [tmp_rowset_key, tmp_rowset_pb] : tmp_rowsets_meta) { + std::string tmp_rowst_data; + err = txn->get(tmp_rowset_key, &tmp_rowst_data); + if (TxnErrorCode::TXN_KEY_NOT_FOUND == err) { + // the tmp rowset has been converted Review Comment: > Add a debug log. 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