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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new a21b017d035 branch-3.0: [fix](cloud) Fix replay default compute group 
failed throw exception #43766 (#43889)
a21b017d035 is described below

commit a21b017d035edd27a3edf600c506dbae940dd21c
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Nov 14 10:19:06 2024 +0800

    branch-3.0: [fix](cloud) Fix replay default compute group failed throw 
exception #43766 (#43889)
    
    Cherry-picked from #43766
    
    Co-authored-by: deardeng <[email protected]>
---
 .../java/org/apache/doris/mysql/privilege/UserProperty.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java
index e334937f2db..e4a76b23820 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java
@@ -260,9 +260,9 @@ public class UserProperty implements Writable {
 
                 newDefaultLoadCluster = value;
             }  else if (keyArr[0].equalsIgnoreCase(DEFAULT_CLOUD_CLUSTER)) {
-                newDefaultCloudCluster = checkCloudDefaultCluster(keyArr, 
value, DEFAULT_CLOUD_CLUSTER);
+                newDefaultCloudCluster = checkCloudDefaultCluster(keyArr, 
value, DEFAULT_CLOUD_CLUSTER, isReplay);
             } else if (keyArr[0].equalsIgnoreCase(DEFAULT_COMPUTE_GROUP)) {
-                newDefaultCloudCluster = checkCloudDefaultCluster(keyArr, 
value, DEFAULT_COMPUTE_GROUP);
+                newDefaultCloudCluster = checkCloudDefaultCluster(keyArr, 
value, DEFAULT_COMPUTE_GROUP, isReplay);
             } else if (keyArr[0].equalsIgnoreCase(PROP_MAX_QUERY_INSTANCES)) {
                 // set property "max_query_instances" = "1000"
                 if (keyArr.length != 1) {
@@ -390,8 +390,12 @@ public class UserProperty implements Writable {
         defaultCloudCluster = newDefaultCloudCluster;
     }
 
-    private String checkCloudDefaultCluster(String[] keyArr, String value, 
String defaultComputeGroup)
+    private String checkCloudDefaultCluster(String[] keyArr, String value, 
String defaultComputeGroup, boolean isReplay)
             throws ComputeGroupException, DdlException {
+        // isReplay not check auth, not throw exception
+        if (isReplay) {
+            return value;
+        }
         // check cluster auth
         if (!Strings.isNullOrEmpty(value) && 
!Env.getCurrentEnv().getAuth().checkCloudPriv(
             new UserIdentity(qualifiedUser, "%"), value, PrivPredicate.USAGE, 
ResourceTypeEnum.CLUSTER)) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to