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

morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit 50083686ae5404effcf29449c8dedaaa50bc8479
Author: Mingyu Chen <morningman....@gmail.com>
AuthorDate: Tue Mar 15 11:45:18 2022 +0800

    [fix](dynamic-partition) fix bug that can not set 
dynamic_partition.replication_allocation property (#8471)
---
 .../main/java/org/apache/doris/catalog/TableProperty.java    | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/TableProperty.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/TableProperty.java
index 7d1c4ca..427b09a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/TableProperty.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/TableProperty.java
@@ -149,6 +149,7 @@ public class TableProperty implements Writable {
 
     public void modifyTableProperties(Map<String, String> modifyProperties) {
         properties.putAll(modifyProperties);
+        removeDuplicateReplicaNumProperty();
     }
 
     public void modifyDataSortInfoProperties(DataSortInfo dataSortInfo) {
@@ -237,7 +238,18 @@ public class TableProperty implements Writable {
                         ReplicaAllocation.DEFAULT_ALLOCATION.toCreateStmt());
             }
         }
+        tableProperty.removeDuplicateReplicaNumProperty();
         tableProperty.buildReplicaAllocation();
         return tableProperty;
     }
+
+    // For some historical reason, both "dynamic_partition.replication_num" 
and "dynamic_partition.replication_allocation"
+    // may be exist in "properties". we need remove the 
"dynamic_partition.replication_num", or it will always replace
+    // the "dynamic_partition.replication_allocation", result in unable to set 
"dynamic_partition.replication_allocation".
+    private void removeDuplicateReplicaNumProperty() {
+        if (properties.containsKey(DynamicPartitionProperty.REPLICATION_NUM)
+                && 
properties.containsKey(DynamicPartitionProperty.REPLICATION_ALLOCATION)) {
+            properties.remove(DynamicPartitionProperty.REPLICATION_NUM);
+        }
+    }
 }

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

Reply via email to