kangpinghuang commented on a change in pull request #1147: Check base tablet 
when clean alter task during startup
URL: https://github.com/apache/incubator-doris/pull/1147#discussion_r283198369
 
 

 ##########
 File path: be/src/olap/tablet_manager.cpp
 ##########
 @@ -258,18 +267,28 @@ void TabletManager::cancel_unfinished_schema_change() {
                            << ", base_tablet=" << tablet->full_name();
                 return;
             }
-
-            res = new_tablet->set_alter_state(ALTER_FAILED);
-            if (res != OLAP_SUCCESS) {
-                LOG(FATAL) << "fail to save new tablet meta. res=" << res
-                           << ", new_tablet=" << new_tablet->full_name();
-                return;
-            }
-            res = new_tablet->save_meta();
-            if (res != OLAP_SUCCESS) {
-                LOG(FATAL) << "fail to save new tablet meta. res=" << res
-                           << ", new_tablet=" << new_tablet->full_name();
-                return;
+            if (new_alter_task == nullptr 
+                && new_tablet->creation_time() < tablet->creation_time()) {
+                // case 1: create new tablet and save meta successfully, but 
failed to save alter state in base tablet
+                // case 2: during clear stage, clear base successfully, but 
faile dto clear new tablet
+                LOG(WARNING) << "base tablet's alter task is null, skip set 
state"
+                             << " base_tablet=" << new_tablet->full_name()
+                             << " create_time=" << new_tablet->creation_time()
+                             << " new_tablet=" << tablet->full_name()
+                             << " create_time=" << tablet->creation_time();
+            } else {
+                res = new_tablet->set_alter_state(ALTER_FAILED);
+                if (res != OLAP_SUCCESS) {
+                    LOG(FATAL) << "fail to save new tablet meta. res=" << res
 
 Review comment:
   modify the failure message. I think failed to set the alter state is better.

----------------------------------------------------------------
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