ccoffline commented on a change in pull request #6416:
URL: https://github.com/apache/incubator-doris/pull/6416#discussion_r699054106



##########
File path: fe/fe-core/src/main/java/org/apache/doris/alter/AlterHandler.java
##########
@@ -302,40 +302,37 @@ protected void jobDone(AlterJob alterJob) {
         }
     }
 
-    public void replayInitJob(AlterJob alterJob, Catalog catalog) {
-        Database db = catalog.getDb(alterJob.getDbId());
+    public void replayInitJob(AlterJob alterJob, Catalog catalog) throws 
MetaNotFoundException {
+        Database db = catalog.getDbOrMetaException(alterJob.getDbId());
         alterJob.replayInitJob(db);
         // add rollup job
         addAlterJob(alterJob);
     }
     
-    public void replayFinishing(AlterJob alterJob, Catalog catalog) {
-        Database db = catalog.getDb(alterJob.getDbId());
+    public void replayFinishing(AlterJob alterJob, Catalog catalog) throws 
MetaNotFoundException {
+        Database db = catalog.getDbOrMetaException(alterJob.getDbId());
         alterJob.replayFinishing(db);
         alterJob.setState(JobState.FINISHING);
         // !!! the alter job should add to the cache again, because the alter 
job is deserialized from journal
         // it is a different object compared to the cache
         addAlterJob(alterJob);
     }
 
-    public void replayFinish(AlterJob alterJob, Catalog catalog) {
-        Database db = catalog.getDb(alterJob.getDbId());
+    public void replayFinish(AlterJob alterJob, Catalog catalog) throws 
MetaNotFoundException {
+        Database db = catalog.getDbOrMetaException(alterJob.getDbId());
         alterJob.replayFinish(db);
         alterJob.setState(JobState.FINISHED);
 
         jobDone(alterJob);
     }
 
-    public void replayCancel(AlterJob alterJob, Catalog catalog) {
+    public void replayCancel(AlterJob alterJob, Catalog catalog) throws 
MetaNotFoundException {
         removeAlterJob(alterJob.getTableId());
         alterJob.setState(JobState.CANCELLED);
-        Database db = catalog.getDb(alterJob.getDbId());
-        if (db != null) {
-            // we log rollup job cancelled even if db is dropped.
-            // so check db != null here
-            alterJob.replayCancel(db);
-        }
-
+        // we log rollup job cancelled even if db is dropped.
+        // so check db != null here
+        Database db = catalog.getDbOrMetaException(alterJob.getDbId());
+        alterJob.replayCancel(db);

Review comment:
       I'll fix this.




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