morningman commented on code in PR #10721:
URL: https://github.com/apache/doris/pull/10721#discussion_r917331120


##########
be/src/olap/tablet_manager.cpp:
##########
@@ -154,13 +154,24 @@ Status TabletManager::_add_tablet_unlocked(TTabletId 
tablet_id, const TabletShar
     // During restore process, snapshot loader
     // replaced the old tablet's rowset with new rowsets, but the tablet path 
is reused, if drop files
     // here, the new rowset's file will also be dropped, so use keep files here
-    bool keep_files = force ? true : false;
+    bool keep_files = force;
     if (force ||
         (new_version > old_version || (new_version == old_version && new_time 
> old_time))) {
         // check if new tablet's meta is in store and add new tablet's meta to 
meta store
         res = _add_tablet_to_map_unlocked(tablet_id, tablet, update_meta, 
keep_files,
                                           true /*drop_old*/);
     } else {
+        if (!keep_files) {
+            tablet->set_tablet_state(TABLET_SHUTDOWN);

Review Comment:
   I am confused that, this is a "add tablet" method, but why we finally set 
tablet to `TABLET_SHUTDOWN`?
   Should it be `existed_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

Reply via email to