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 e417a5cc3626213c2e77d8a57ec8613f1a1f4882
Author: camby <[email protected]>
AuthorDate: Fri May 10 13:46:48 2024 +0800

    [fix](replication_allocation) fix two problems for 
force_olap_table_replication_allocation #34554
---
 .../main/java/org/apache/doris/common/util/DynamicPartitionUtil.java | 3 ++-
 .../main/java/org/apache/doris/mysql/privilege/UserPropertyMgr.java  | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java
index 4464473788f..fe29dfe7eea 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java
@@ -636,7 +636,8 @@ public class DynamicPartitionUtil {
 
         // check replication_allocation first, then replciation_num
         ReplicaAllocation replicaAlloc = null;
-        if 
(properties.containsKey(DynamicPartitionProperty.REPLICATION_ALLOCATION)) {
+        if (!Config.force_olap_table_replication_allocation.isEmpty()
+                || 
properties.containsKey(DynamicPartitionProperty.REPLICATION_ALLOCATION)) {
             replicaAlloc = 
PropertyAnalyzer.analyzeReplicaAllocation(properties, "dynamic_partition");
             properties.remove(DynamicPartitionProperty.REPLICATION_ALLOCATION);
             
analyzedProperties.put(DynamicPartitionProperty.REPLICATION_ALLOCATION, 
replicaAlloc.toCreateStmt());
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPropertyMgr.java
 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPropertyMgr.java
index aaeaa992ab3..c9358734d97 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPropertyMgr.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPropertyMgr.java
@@ -137,9 +137,10 @@ public class UserPropertyMgr implements Writable {
         Set<Tag> tags = existProperty.getCopiedResourceTags();
         // only root and admin can return empty tag.
         // empty tag means user can access all backends.
-        // for normal user, if tag is empty, use default tag.
+        // for normal user, if tag is empty and not set 
force_olap_table_replication_allocation, use default tag.
         if (tags.isEmpty() && !(qualifiedUser.equalsIgnoreCase(Auth.ROOT_USER)
-                || qualifiedUser.equalsIgnoreCase(Auth.ADMIN_USER))) {
+                || qualifiedUser.equalsIgnoreCase(Auth.ADMIN_USER))
+                && Config.force_olap_table_replication_allocation.isEmpty()) {
             tags = Sets.newHashSet(Tag.DEFAULT_BACKEND_TAG);
         }
         return tags;


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

Reply via email to