From 3431b1f156b05866e4f9a368304216974f047c43 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Wed, 29 Nov 2023 13:40:06 +0800 Subject: [PATCH] format cpu config as redis style (#7351) The following four configurations are renamed to align with Redis style: 1. server_cpulist renamed to server-cpulist 2. bio_cpulist renamed to bio-cpulist 3. aof_rewrite_cpulist renamed to aof-rewrite-cpulist 4. bgsave_cpulist renamed to bgsave-cpulist The original names are retained as aliases to ensure compatibility with old configuration files. We recommend users to gradually transition to using the new configuration names to maintain consistency in style. --- redis.conf | 8 ++++---- src/config.c | 8 ++++---- tests/unit/introspection.tcl | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/redis.conf b/redis.conf index e2c80eb64..5296a6fa5 100644 --- a/redis.conf +++ b/redis.conf @@ -2280,16 +2280,16 @@ jemalloc-bg-thread yes # the taskset command: # # Set redis server/io threads to cpu affinity 0,2,4,6: -# server_cpulist 0-7:2 +# server-cpulist 0-7:2 # # Set bio threads to cpu affinity 1,3: -# bio_cpulist 1,3 +# bio-cpulist 1,3 # # Set aof rewrite child process to cpu affinity 8,9,10,11: -# aof_rewrite_cpulist 8-11 +# aof-rewrite-cpulist 8-11 # # Set bgsave child process to cpu affinity 1,10,11 -# bgsave_cpulist 1,10-11 +# bgsave-cpulist 1,10-11 # In some cases redis will emit warnings and even refuse to start if it detects # that the system is in bad state, it is possible to suppress these warnings diff --git a/src/config.c b/src/config.c index 5684a082c..3231b2442 100644 --- a/src/config.c +++ b/src/config.c @@ -3113,10 +3113,10 @@ standardConfig static_configs[] = { createStringConfig("dbfilename", NULL, MODIFIABLE_CONFIG | PROTECTED_CONFIG, ALLOW_EMPTY_STRING, server.rdb_filename, "dump.rdb", isValidDBfilename, NULL), createStringConfig("appendfilename", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, server.aof_filename, "appendonly.aof", isValidAOFfilename, NULL), createStringConfig("appenddirname", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, server.aof_dirname, "appendonlydir", isValidAOFdirname, NULL), - createStringConfig("server_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.server_cpulist, NULL, NULL, NULL), - createStringConfig("bio_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.bio_cpulist, NULL, NULL, NULL), - createStringConfig("aof_rewrite_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.aof_rewrite_cpulist, NULL, NULL, NULL), - createStringConfig("bgsave_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.bgsave_cpulist, NULL, NULL, NULL), + createStringConfig("server-cpulist", "server_cpulist", IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.server_cpulist, NULL, NULL, NULL), + createStringConfig("bio-cpulist", "bio_cpulist", IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.bio_cpulist, NULL, NULL, NULL), + createStringConfig("aof-rewrite-cpulist", "aof_rewrite_cpulist", IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.aof_rewrite_cpulist, NULL, NULL, NULL), + createStringConfig("bgsave-cpulist", "bgsave_cpulist", IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, server.bgsave_cpulist, NULL, NULL, NULL), createStringConfig("ignore-warnings", NULL, MODIFIABLE_CONFIG, ALLOW_EMPTY_STRING, server.ignore_warnings, "", NULL, NULL), createStringConfig("proc-title-template", NULL, MODIFIABLE_CONFIG, ALLOW_EMPTY_STRING, server.proc_title_template, CONFIG_DEFAULT_PROC_TITLE_TEMPLATE, isValidProcTitleTemplate, updateProcTitleTemplate), createStringConfig("bind-source-addr", NULL, MODIFIABLE_CONFIG, EMPTY_STRING_IS_NULL, server.bind_source_addr, NULL, NULL, NULL), diff --git a/tests/unit/introspection.tcl b/tests/unit/introspection.tcl index d551440ce..3bb721275 100644 --- a/tests/unit/introspection.tcl +++ b/tests/unit/introspection.tcl @@ -407,6 +407,10 @@ start_server {tags {"introspection"}} { replicaof slaveof requirepass + server-cpulist + bio-cpulist + aof-rewrite-cpulist + bgsave-cpulist server_cpulist bio_cpulist aof_rewrite_cpulist