Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(redis): redis忽略传入MaxMemory #8507 #8508

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ import (
// RedisInstallParams 安装参数
type RedisInstallParams struct {
common.MediaPkg
DbToolsPkg common.DbToolsMediaPkg `json:"dbtoolspkg"`
RedisModulesPkg common.RedisModulesMediaPkg `json:"redis_modules_pkg"`
DataDirs []string `json:"data_dirs"`
IP string `json:"ip" validate:"required"`
Ports []int `json:"ports"` // 如果端口不连续,可直接指定端口
StartPort int `json:"start_port"` // 如果端口连续,则可直接指定起始端口和实例个数
InstNum int `json:"inst_num"`
Password string `json:"password" validate:"required"`
Databases int `json:"databases" validate:"required"`
RedisConfConfigs map[string]string `json:"redis_conf_configs" validate:"required"`
DbType string `json:"db_type" validate:"required"`
MaxMemory uint64 `json:"maxmemory"`
LoadModulesDetail []LoadModuleItem `json:"load_modules_detail"`
DbToolsPkg common.DbToolsMediaPkg `json:"dbtoolspkg"`
RedisModulesPkg common.RedisModulesMediaPkg `json:"redis_modules_pkg"`
DataDirs []string `json:"data_dirs"`
IP string `json:"ip" validate:"required"`
Ports []int `json:"ports"` // 如果端口不连续,可直接指定端口
StartPort int `json:"start_port"` // 如果端口连续,则可直接指定起始端口和实例个数
InstNum int `json:"inst_num"`
Password string `json:"password" validate:"required"`
Databases int `json:"databases" validate:"required"`
RedisConfConfigs map[string]string `json:"redis_conf_configs" validate:"required"`
DbType string `json:"db_type" validate:"required"`
// MaxMemory uint64 `json:"maxmemory"` //不要它了撒
LoadModulesDetail []LoadModuleItem `json:"load_modules_detail"`
}

// LoadModuleItem 加载module信息
Expand Down Expand Up @@ -539,7 +539,7 @@ func (job *RedisInstall) GenerateConfigFile(port int) (err error) {
confData = strings.ReplaceAll(confData, "{{redis_data_dir}}", instDir)
confData = strings.ReplaceAll(confData, "{{databases}}", strconv.Itoa(job.params.Databases))
confData = strings.ReplaceAll(confData, "{{cluster_enabled}}", clusterEnabled)
confData = strings.ReplaceAll(confData, "{{maxmemory}}", strconv.FormatUint(job.params.MaxMemory, 10))
confData = strings.ReplaceAll(confData, "{{maxmemory}}", "0")
confData = strings.ReplaceAll(confData, "{{rocks_blockcachemb}}", strconv.FormatUint(instBlockcache, 10))
confData = strings.ReplaceAll(confData, "{{rocks_write_buffer_size}}",
strconv.FormatUint(writeBufferSize, 10))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (test *RedisInstallTest) SetMaxMemory(maxMemory uint64) *RedisInstallTest {
if test.Err != nil {
return test
}
test.MaxMemory = maxMemory
// test.MaxMemory = maxMemory
return test
}

Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/backend/flow/utils/redis/redis_act_playload.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ def get_redis_install_4_scene(self, **kwargs) -> dict:
# tendisplus cluster 模式暂时不需要特别指定这两个参数
if is_twemproxy_proxy_type(self.namespace):
install_payload["databases"] = int(redis_config["databases"])
install_payload["maxmemory"] = int(float(redis_config["maxmemory"]))
# install_payload["maxmemory"] = int(float(redis_config["maxmemory"])) ##不要它了,dbmon会动态的设置

return {
"db_type": DBActuatorTypeEnum.Redis.value,
Expand Down
Loading