SWJTU-ZhangLei commented on code in PR #38243: URL: https://github.com/apache/doris/pull/38243#discussion_r1706546681
########## 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; Review Comment: > `partition_versions` is not needed here, since all rowsets belong to the same partition. Read the partition version in here directly. `convert_tmp_rowsets` is a common api, all roswets not belong to the same partition also work -- 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