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



##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -4548,72 +4476,43 @@ private void unprotectUpdateReplica(ReplicaPersistInfo 
info) {
         replica.setBad(false);
     }
 
-    public void replayAddReplica(ReplicaPersistInfo info) {
-        Database db = getDb(info.getDbId());
-        OlapTable olapTable = (OlapTable) db.getTable(info.getTableId());
-        if (olapTable == null) {
-            /**
-             * Same as replayUpdateReplica()
-             */
-            LOG.warn("Olap table is null when the add replica log is replayed, 
{}", info);
-            return;
-        }
+    public void replayAddReplica(ReplicaPersistInfo info) throws 
MetaNotFoundException {
+        Database db = this.getDbOrMetaException(info.getDbId());
+        OlapTable olapTable = db.getTableOrMetaException(info.getTableId(), 
TableType.OLAP);
         olapTable.writeLock();
         try {
-            unprotectAddReplica(info);
+            unprotectAddReplica(olapTable, info);
         } finally {
             olapTable.writeUnlock();
         }
     }
 
-    public void replayUpdateReplica(ReplicaPersistInfo info) {
-        Database db = getDb(info.getDbId());
-        OlapTable olapTable = (OlapTable) db.getTable(info.getTableId());
-        if (olapTable == null) {

Review comment:
       ok




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