Skip to content

Conversation

@hwware
Copy link
Contributor

@hwware hwware commented Jul 29, 2021

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:

  1. SENTINEL DEBUG: display our current configurable parameters value
    Capture

  2. 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

@hwware hwware changed the title Add sentinel debug option command WIP--Add sentinel debug option command Jul 29, 2021
@hwware
Copy link
Contributor Author

hwware commented Aug 3, 2021

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.
Thus the SENTINEL DEBUG format will be sentinel debug [ ...]
We will skipp writing this to config file and not accepting it from config file as well.

@hwware hwware marked this pull request as draft August 3, 2021 18:48
@hwware hwware changed the title WIP--Add sentinel debug option command Add sentinel debug option command Aug 3, 2021
hwware added 2 commits August 3, 2021 15:49
Once sentinel_ping_period update, then sentinel_tilt_period will be updated as well
@hwware hwware marked this pull request as ready for review August 3, 2021 20:20
@hwware hwware requested a review from yossigo August 3, 2021 20:46
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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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> */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: trailing whitespace.

Copy link
Contributor Author

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
Comment on lines 2041 to 2042
}
else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra newline.

@yossigo yossigo merged commit 63e2a6d into redis:unstable Aug 5, 2021
@yossigo
Copy link
Collaborator

yossigo commented Aug 5, 2021

Merged, thanks @hwware!

JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Sep 8, 2021
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>
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Feb 7, 2022
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.
oranagra pushed a commit that referenced this pull request Feb 7, 2022
…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.
guanmengshi added a commit to guanmengshi/redis that referenced this pull request Feb 8, 2022
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.
oranagra pushed a commit that referenced this pull request Feb 8, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants