-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Add sentinel debug option command #9291
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
Conversation
|
DEBUG command has many subcommands. For example, DEBUG set-skip-cheksum-validation 0|1, DEBUG lua-always-replicate-commands 0|1 etc. Here we want to modify the config parameters only for test purpose instead of in a real world system. |
Once sentinel_ping_period update, then sentinel_tilt_period will be updated as well
src/sentinel.c
Outdated
| static mstime_t sentinel_info_period = 10000; | ||
| static mstime_t sentinel_ping_period = SENTINEL_PING_PERIOD; | ||
| static mstime_t sentinel_ask_period = 1000; | ||
| static mstime_t sentinel_publish_period = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| static mstime_t sentinel_publish_period = 1000; | |
| static mstime_t sentinel_publish_period = 2000; |
I assume we want to preserve the old behavior.
src/sentinel.c
Outdated
| } | ||
| } else if (!strcasecmp(argv[0],"announce-ip") && argc == 2) { | ||
| /* announce-ip <ip-address> */ | ||
| /* announce-ip <ip-address> */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: trailing whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
src/sentinel.c
Outdated
| } | ||
| else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra newline.
|
Merged, thanks @hwware! |
This makes it possible to tune many parameters that were previously hard coded. We don't intend these to be user configurable, but only used by tests to accelerate certain conditions which would otherwise take a long time and slow down the test suite. Co-authored-by: Lucas Guang Yang <l84193800@china.huawei.com>
Because SENTINEL DEBUG missing summary in its json file, with the change in redis#10043, the following assertion will fail. ``` [redis]# src/redis-cli -p 26379 redis-cli: redis-cli.c:678: cliInitCommandHelpEntry: Assertion `reply->type == 1' failed. ``` This commit add the summary and complexity for SENTINEL DEBUG, which introduced in redis#9291, and also improved the help message.
…ry (#10250) Fix redis-cli with sentinel crash due to SENTINEL DEBUG missing summary Because SENTINEL DEBUG missing summary in its json file, with the change in #10043, the following assertion will fail. ``` [redis]# src/redis-cli -p 26379 redis-cli: redis-cli.c:678: cliInitCommandHelpEntry: Assertion `reply->type == 1' failed. ``` This commit add the summary and complexity for SENTINEL DEBUG, which introduced in #9291, and also improved the help message.
There are two issues in SENTINEL DEBUG: 1. The error message should mention SENTINEL DEBUG 2. Add missing reuturn in args parse. ``` redis> sentinel debug INFO-PERIOD aaa (error) ERR Invalid argument 'aaa' for SENTINEL SET 'INFO-PERIOD' redis> sentinel debug a b c d (error) ERR Unknown option or number of arguments for SENTINEL SET 'a' redis> ping (error) ERR Unknown option or number of arguments for SENTINEL SET 'b' ``` Introduced in redis#9291. Also do some cleanups in the code.
There are two issues in SENTINEL DEBUG: 1. The error message should mention SENTINEL DEBUG 2. Add missing reuturn in args parse. ``` redis> sentinel debug INFO-PERIOD aaa (error) ERR Invalid argument 'aaa' for SENTINEL SET 'INFO-PERIOD' redis> sentinel debug a b c d (error) ERR Unknown option or number of arguments for SENTINEL SET 'a' redis> ping (error) ERR Unknown option or number of arguments for SENTINEL SET 'b' ``` Introduced in #9291. Also do some cleanups in the code.
For test purpose, we could change some parameters by SENTINEL DEBUG command
It is mentioned in the following 2 PR:
#8891 and #8710
The command format has 2 options:
SENTINEL DEBUG: display our current configurable parameters value

SENTINEL DEBUG [ ...]: update our current configurable parameters values (one or more)
for example: sentinel debug info-period 6000
These configurable parameters as following:
SENTINEL_INFO_PERIOD
SENTINEL_PING_PERIOD
SENTINEL_ASK_PERIOD
SENTINEL_PUBLISH_PERIOD
SENTINEL_DEFAULT_DOWN_AFTER
SENTINEL_TILT_TRIGGER
SENTINEL_TILT_PERIOD
SENTINEL_SLAVE_RECONF_TIMEOUT
SENTINEL_MIN_LINK_RECONNECT_PERIOD
SENTINEL_ELECTION_TIMEOUT
SENTINEL_SCRIPT_MAX_RUNTIME
SENTINEL_SCRIPT_RETRY_DELAY
SENTINEL_DEFAULT_FAILOVER_TIMEOUT