From ccf08825737cd291aacc5a70a44973deec78e02a Mon Sep 17 00:00:00 2001 From: walter Date: Thu, 31 Oct 2024 10:33:46 +0800 Subject: [PATCH] [chore](restore) Save restore stmt to the resp if RestoreSnapshot failed (#42933) --- .../org/apache/doris/service/FrontendServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 d5aef9a78e3969..9dbd0afd1c319f 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 @@ -2928,7 +2928,7 @@ private TRestoreSnapshotResult restoreSnapshotImpl(TRestoreSnapshotRequest reque RestoreStmt restoreStmt = new RestoreStmt(label, repoName, restoreTableRefClause, properties, request.getMeta(), request.getJobInfo()); restoreStmt.setIsBeingSynced(); - LOG.trace("restore snapshot info, restoreStmt: {}", restoreStmt); + LOG.debug("restore snapshot info, restoreStmt: {}", restoreStmt); try { ConnectContext ctx = ConnectContext.get(); if (ctx == null) { @@ -2946,13 +2946,13 @@ private TRestoreSnapshotResult restoreSnapshotImpl(TRestoreSnapshotRequest reque restoreStmt.analyze(analyzer); DdlExecutor.execute(Env.getCurrentEnv(), restoreStmt); } catch (UserException e) { - LOG.warn("failed to restore: {}", e.getMessage(), e); + LOG.warn("failed to restore: {}, stmt: {}", e.getMessage(), restoreStmt, e); status.setStatusCode(TStatusCode.ANALYSIS_ERROR); - status.addToErrorMsgs(e.getMessage()); + status.addToErrorMsgs(e.getMessage() + ", stmt: " + restoreStmt.toString()); } catch (Throwable e) { - LOG.warn("catch unknown result.", e); + LOG.warn("catch unknown result. stmt: {}", restoreStmt, e); status.setStatusCode(TStatusCode.INTERNAL_ERROR); - status.addToErrorMsgs(Strings.nullToEmpty(e.getMessage())); + status.addToErrorMsgs(Strings.nullToEmpty(e.getMessage()) + ", stmt: " + restoreStmt.toString()); } return result;