yujun777 commented on code in PR #34889: URL: https://github.com/apache/doris/pull/34889#discussion_r1624654234
########## be/src/olap/tablet_manager.cpp: ########## @@ -1221,16 +1258,61 @@ bool TabletManager::_move_tablet_to_trash(const TabletSharedPtr& tablet) { } } -bool TabletManager::register_clone_tablet(int64_t tablet_id) { +Status TabletManager::register_transition_tablet(int64_t tablet_id, std::string reason) { tablets_shard& shard = _get_tablets_shard(tablet_id); - std::lock_guard<std::shared_mutex> wrlock(shard.lock); - return shard.tablets_under_clone.insert(tablet_id).second; + std::lock_guard<std::mutex> lk(shard.lock_for_transition); + std::thread::id thread_id = std::this_thread::get_id(); + if (auto search = shard.tablets_under_transition.find(tablet_id); + search == shard.tablets_under_transition.end()) { + // not found + shard.tablets_under_transition[tablet_id] = std::make_tuple(reason, thread_id, 1); + LOG(INFO) << "add tablet_id= " << tablet_id << " to map, reason=" << reason Review Comment: can it move LOG outside of the lock ? also for LOG in unregister_transition_tablet -- 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