This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 867fa39341d [hotfix](priv) Fix restore snapshot user priv with add
cluster in UserIdentity (#26969) (#27210)
867fa39341d is described below
commit 867fa39341d848e6ef2a3673686cb30e36076cba
Author: Jack Drogon <[email protected]>
AuthorDate: Sat Nov 18 00:12:01 2023 +0800
[hotfix](priv) Fix restore snapshot user priv with add cluster in
UserIdentity (#26969) (#27210)
Signed-off-by: Jack Drogon <[email protected]>
---
fe/fe-core/src/main/java/org/apache/doris/binlog/DBBinlog.java | 2 ++
.../src/main/java/org/apache/doris/service/FrontendServiceImpl.java | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/binlog/DBBinlog.java
b/fe/fe-core/src/main/java/org/apache/doris/binlog/DBBinlog.java
index 58cb30bddea..4ba1416cd5c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/binlog/DBBinlog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/binlog/DBBinlog.java
@@ -181,6 +181,7 @@ public class DBBinlog {
if (tableId >= 0) {
TableBinlog tableBinlog = tableBinlogMap.get(tableId);
if (tableBinlog == null) {
+ LOG.warn("table binlog not found. tableId: {}", tableId);
status.setStatusCode(TStatusCode.BINLOG_NOT_FOUND_TABLE);
return Pair.of(status, null);
}
@@ -200,6 +201,7 @@ public class DBBinlog {
if (tableId >= 0) {
TableBinlog tableBinlog = tableBinlogMap.get(tableId);
if (tableBinlog == null) {
+ LOG.warn("table binlog not found. tableId: {}", tableId);
status.setStatusCode(TStatusCode.BINLOG_NOT_FOUND_TABLE);
return Pair.of(status, null);
}
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 cae63209120..792d00bd63d 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
@@ -2894,7 +2894,8 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
}
ctx.setCluster(cluster);
ctx.setQualifiedUser(request.getUser());
- UserIdentity currentUserIdentity = new
UserIdentity(request.getUser(), "%");
+ String fullUserName = ClusterNamespace.getFullName(cluster,
request.getUser());
+ UserIdentity currentUserIdentity = new UserIdentity(fullUserName,
"%");
currentUserIdentity.setIsAnalyzed();
ctx.setCurrentUserIdentity(currentUserIdentity);
@@ -2902,7 +2903,7 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
restoreStmt.analyze(analyzer);
DdlExecutor.execute(Env.getCurrentEnv(), restoreStmt);
} catch (UserException e) {
- LOG.warn("failed to get snapshot info: {}", e.getMessage());
+ LOG.warn("failed to restore: {}", e.getMessage(), e);
status.setStatusCode(TStatusCode.ANALYSIS_ERROR);
status.addToErrorMsgs(e.getMessage());
} catch (Throwable e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]