Skip to content

Conversation

@guanmengshi
Copy link
Contributor

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.

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.
Copy link
Contributor

@enjoy-binbin enjoy-binbin left a comment

Choose a reason for hiding this comment

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

thanks, LGTM, i like the cleanup jobs. i suppose DEBUG command, we can skip the test

now with the cmd->fullname, i suppose we can use it and avoid the hard code "SENTINEL DEBUG"
and i see the code is copy from SENTINEL SET, we can also use the fullname too, if needed (it will need to update the test)

@enjoy-binbin enjoy-binbin added the state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten label Feb 8, 2022
@enjoy-binbin
Copy link
Contributor

enjoy-binbin commented Feb 8, 2022

ohh i now realize that with fullname the error message would be weird, we can keep it as it is
@oranagra i suppose we can just merge this one (small bug fixes)
btw, sentinel debug is not affected by the enable-debug-command parameter

127.0.0.1:26379> sentinel debug info-preiod
(error) ERR Unknown option or number of arguments for sentinel|debug 'info-preiod'
127.0.0.1:26379> sentinel debug a b
(error) ERR Unknown option or number of arguments for sentinel|debug 'a'

@oranagra
Copy link
Member

oranagra commented Feb 8, 2022

The reasons the DEBUG command got protected are:

  1. it is dangerous (allows SEGFAULT and MALLCTL)
  2. it wasn't intended for users to use (mainly for developers and testing)

for these reasons we wanted to reduce the attack surface for naive users by default.

I'm not very keen on the details of SENTINEL DEBUG, i suppose it doesn't fall into the first category, and that it does fall into the second. is that right?

@moticless @yossigo please confirm.

@hwware
Copy link
Contributor

hwware commented Feb 8, 2022

The reasons the DEBUG command got protected are:

  1. it is dangerous (allows SEGFAULT and MALLCTL)
  2. it wasn't intended for users to use (mainly for developers and testing)

for these reasons we wanted to reduce the attack surface for naive users by default.

I'm not very keen on the details of SENTINEL DEBUG, i suppose it doesn't fall into the first category, and that it does fall into the second. is that right?

@moticless @yossigo please confirm.

Hi Oran, Sentinel debug command basically used to in the test like what you mentioned above.

@moticless moticless self-requested a review February 8, 2022 16:11
@oranagra oranagra merged commit 0990dec into redis:unstable Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants