Skip to content

Commit

Permalink
fix(backend): redis cluster部署方案参数修复 #8390
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud committed Dec 3, 2024
1 parent 95e45b6 commit a03dc01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dbm-ui/backend/db_services/dbresource/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ def custom_filter(self):
pass

def get_target_specs(self):
if not self.specs:
return []

self.calc_machine_pair()
self.calc_cluster_shard_num()
self.system_filter()
self.custom_filter()

return self.specs


Expand Down Expand Up @@ -196,6 +200,11 @@ class RedisClusterSpecFilter(RedisSpecFilter):
# 支持简单阔缩容倍数(非DTS方式/Slot迁移扩容方式)
SCALE_MULITPLE = 4

def __init__(self, capacity, future_capacity, spec_cluster_type, spec_machine_type, qps=None, shard_num=0):
# 这里的规格类型要转为tendis cache, redis cluster的规格类型同cache
spec_machine_type = SpecMachineType.TendisTwemproxyRedisInstance
super().__init__(capacity, future_capacity, spec_cluster_type, spec_machine_type, qps, shard_num)

def calc_machine_pair(self):
"""计算每种规格所需的机器组数和集群总容量: 目标容量 / 规格容量"""
for spec in self.specs:
Expand Down

0 comments on commit a03dc01

Please sign in to comment.