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



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java
##########
@@ -218,9 +215,9 @@ protected void runPendingJob() throws AlterCancelException {
         }
         MarkedCountDownLatch<Long, Long> countDownLatch = new 
MarkedCountDownLatch<>(totalReplicaNum);
 
-        OlapTable tbl = null;
+        OlapTable tbl;
         try {
-            tbl = (OlapTable) db.getTableOrThrowException(tableId, 
TableType.OLAP);
+            tbl = db.getTableOrMetaException(tableId, TableType.OLAP);

Review comment:
       This checks if the table exists and if the table is OLAP, so it might be 
easier to code this way.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/alter/Alter.java
##########
@@ -260,17 +251,11 @@ private void processModifyColumnComment(Database db, 
OlapTable tbl, List<AlterCl
         }
     }
 
-    public void replayModifyComment(ModifyCommentOperationLog operation) {
+    public void replayModifyComment(ModifyCommentOperationLog operation) 
throws MetaNotFoundException {

Review comment:
       @caiconghui we don't have any promise that the edit logs are in order. 
These check code is to prevent the worst from happening.
   Edit logs that out of order may cause meta inconsistent, which has to be 
fixes sooner or later. We are exploring ways to ensure consistency and minimize 
the cost. Until then, we have to check all NPE or let all the FE to crash.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/alter/Alter.java
##########
@@ -260,17 +251,11 @@ private void processModifyColumnComment(Database db, 
OlapTable tbl, List<AlterCl
         }
     }
 
-    public void replayModifyComment(ModifyCommentOperationLog operation) {
+    public void replayModifyComment(ModifyCommentOperationLog operation) 
throws MetaNotFoundException {

Review comment:
       @caiconghui we don't have any promise that the edit logs are in order. 
These check code is to prevent the worst from happening.
   Edit logs that out of order may cause meta inconsistent, which has to be 
fixed sooner or later. We are exploring ways to ensure consistency and minimize 
the cost. Until then, we have to check all NPE or let all the FE to crash.




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