You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/10 04:23:23 UTC

[GitHub] [doris] weizuo93 commented on a diff in pull request #10721: [Bug] Fix bug that segments are removed as trash but tablet meta is normal

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


##########
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`?
   
   @morningman 
   Yes, it may be `existed_tablet` due to misoperation of the disk. You can refer to this issue #10720 



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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