morningman commented on a change in pull request #3051: Support sharding 
tablet_map_lock into more small map locks to make good performance for tablet 
manage task
URL: https://github.com/apache/incubator-doris/pull/3051#discussion_r389238849
 
 

 ##########
 File path: be/src/olap/tablet_manager.cpp
 ##########
 @@ -533,11 +551,12 @@ OLAPStatus TabletManager::_drop_tablet_unlocked(
 OLAPStatus TabletManager::drop_tablets_on_error_root_path(
         const vector<TabletInfo>& tablet_info_vec) {
     OLAPStatus res = OLAP_SUCCESS;
-    WriteLock wlock(&_tablet_map_lock);
 
     for (const TabletInfo& tablet_info : tablet_info_vec) {
         TTabletId tablet_id = tablet_info.tablet_id;
         TSchemaHash schema_hash = tablet_info.schema_hash;
+        RWMutex& tablet_map_lock = _get_tablet_map_lock(tablet_id);
+        WriteLock wlock(&tablet_map_lock);
 
 Review comment:
   When there are lots of tablet in `tablet_info_vec`, there will be many 
lock/unlock operation. Does  it matter?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to