yujun777 commented on code in PR #34889:
URL: https://github.com/apache/doris/pull/34889#discussion_r1624652811


##########
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();

Review Comment:
   move std::this_thread::get_id() outside of the scope of the lock.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to