The problem/use-case that the feature addresses

If the user wants to access configuration variables like down-after-milliseconds, the user can not access it or will need to check the config file.

Description of the feature

In sentinel.c, you can set config variables like "down-after-milliseconds", "failover-timeout", etc in sentinelSetCommand. There is no similar function to get the values of these variables. I think there should be a function sentinelGetCommand for this purpose. For example there is a sentinelConfigGetCommand paired with sentinelConfigSetCommand for global Sentinel configuration parameter.

Comment From: yossigo

@hwware It makes sense, but I wonder if anyone came across this as an issue?

Comment From: hwware

@hwware It makes sense, but I wonder if anyone came across this as an issue?

@yossigo Sorry for reply to you a little bit late. Some engineers wish there is a way to check current sentinel config parameters, because in most time, they can not check these parameters through the file (permission or physical reason ).

Comment From: moticless

@hwware , it looks to me that there is already an option to retrieve the variables you mentioned:

127.0.0.1:5000> sentinel set mymaster down-after-milliseconds 1234
127.0.0.1:5000> sentinel set mymaster failover-timeout 567890
OK
127.0.0.1:5000> sentinel master mymaster
...
21) "down-after-milliseconds"
22) "1234"
...
37) "failover-timeout"
38) "567890"
...

Am I missing something?

Comment From: hwware

@hwware , it looks to me that there is already an option to retrieve the variables you mentioned:

127.0.0.1:5000> sentinel set mymaster down-after-milliseconds 1234 127.0.0.1:5000> sentinel set mymaster failover-timeout 567890 OK 127.0.0.1:5000> sentinel master mymaster ... 21) "down-after-milliseconds" 22) "1234" ... 37) "failover-timeout" 38) "567890" ...

Am I missing something?

Hi Moti, you are right. Now we already have the command to get the information of all monitored masters and their state, which is command: sentinel masters and the command to show the state and info of the specified master, which is sentinel master master-name

Above two commands already implement the first 2 functions of PR https://github.com/redis/redis/pull/10158. Thus, for this PR, I will implement the option 3 (SENTINEL get mymaster down-after-milliseconds) and 4 (SENTINEL get down-after-milliseconds) to continue enhancing the function to get more specific parameter for one or more masters.

Thanks for your help.