This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit b69acbf98bf8395dd2b4477ce1362f20b408a9ba
Author: huanghaibin <284824...@qq.com>
AuthorDate: Tue Feb 20 09:21:31 2024 +0800

    [Improvement](group commit) FE should throw NotFoundException if database 
or table not exist when loading data (#31113)
    
    * [Improvement](group commit) FE should throw NotFoundException if database 
or table not exist when loading data
    
    * edit
---
 .../java/org/apache/doris/service/FrontendServiceImpl.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java 
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index bfce1a8f7ae..34050c2dced 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -1108,6 +1108,10 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
             status.setStatusCode(TStatusCode.LABEL_ALREADY_EXISTS);
             status.addToErrorMsgs(e.getMessage());
             result.setJobStatus(e.getJobStatus());
+        } catch (MetaNotFoundException e) {
+            LOG.warn("failed to begin", e);
+            status.setStatusCode(TStatusCode.NOT_FOUND);
+            status.addToErrorMsgs(e.getMessage());
         } catch (UserException e) {
             LOG.warn("failed to begin: {}", e.getMessage());
             status.setStatusCode(TStatusCode.ANALYSIS_ERROR);
@@ -1145,7 +1149,7 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
             if (Strings.isNullOrEmpty(request.getCluster())) {
                 dbName = request.getDb();
             }
-            throw new UserException("unknown database, database=" + dbName);
+            throw new MetaNotFoundException("unknown database, database=" + 
dbName);
         }
 
         OlapTable table = (OlapTable) db.getTableOrMetaException(request.tbl, 
TableType.OLAP);
@@ -1249,7 +1253,7 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
             if (Strings.isNullOrEmpty(request.getCluster())) {
                 dbName = request.getDb();
             }
-            throw new UserException("unknown database, database=" + dbName);
+            throw new MetaNotFoundException("unknown database, database=" + 
dbName);
         }
 
         // step 4: fetch all tableIds
@@ -1679,6 +1683,11 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
         }
         try {
             loadTxnRollbackImpl(request);
+        } catch (MetaNotFoundException e) {
+            String msg = "failed to rollback txn" + request.getTxnId();
+            LOG.warn(msg, e);
+            status.setStatusCode(TStatusCode.NOT_FOUND);
+            status.addToErrorMsgs(e.getMessage());
         } catch (UserException e) {
             LOG.warn("failed to rollback txn {}: {}", request.getTxnId(), 
e.getMessage());
             status.setStatusCode(TStatusCode.ANALYSIS_ERROR);


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

Reply via email to