[fix](replication_allocation) fix two problems for force_olap_table_replication_allocation #34554
This commit is contained in:
@ -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());
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user