chaoyli commented on a change in pull request #932: Refactor tablet mgr code
URL: https://github.com/apache/incubator-doris/pull/932#discussion_r276063288
 
 

 ##########
 File path: be/src/olap/tablet_manager.cpp
 ##########
 @@ -132,11 +134,44 @@ OLAPStatus TabletManager::add_tablet(TTabletId 
tablet_id, SchemaHash schema_hash
     bool keep_files = force ? true : false;
     if (force || (new_version > old_version
             || (new_version == old_version && new_time > old_time))) {
-        drop_tablet(tablet_id, schema_hash, keep_files);
-        _tablet_map_lock.wrlock();
+        // check if new tablet's meta is in store and add new tablet's meta to 
meta store
+        TabletMetaSharedPtr new_tablet_meta(new(nothrow) TabletMeta());
+        if (new_tablet_meta == nullptr) {
+            LOG(WARNING) << "fail to malloc TabletMeta.";
+            return OLAP_ERR_MALLOC_ERROR;
+        }
+        OLAPStatus check_st = 
TabletMetaManager::get_header(tablet->data_dir(), 
+            tablet->tablet_id(), tablet->schema_hash(), new_tablet_meta);
+        if (check_st == OLAP_ERR_META_KEY_NOT_FOUND) {
 
 Review comment:
   Why we need to save meta?

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


With regards,
Apache Git Services

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

Reply via email to