Skip to content
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

Improve INFO command for Sentinel internal failover feature #22

Open
duongcongtoai opened this issue Jul 31, 2021 · 1 comment
Open

Comments

@duongcongtoai
Copy link
Collaborator

duongcongtoai commented Jul 31, 2021

Redis' Info commands return a lot of information, but only these are required by Sentinel:
For slave:

run_id:4ba98afd1b8655725d9cbe64d9551bde0ceeffa0
role:slave
master_host:127.0.0.1
master_port:6381
master_link_status:down
slave_repl_offset:0
master_link_down_since_seconds:-1
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover

Master

run_id:5a4dfcf77726cfcda754cbdc0a42d1cec6a7348d
role:master
connected_slaves:1
slave0:ip=127.0.0.1,port=6379,state=online,offset=42,lag=0
master_failover_state:no-failover

Explain:

  • master_link_down_since_seconds: now() - last successful ping to master (or last ping received from master)
  • master_failover_state: TBU
  • master_link_status: current slave cannot contact with master
  • slave_read_only: slave only executes read request
  • slave_priority: a criteria used when promoting slaves to be new master (TBU)
  • slave_repl_offset: TBU
  • run_id: unique id of an instance, only null on the first run
  • slavex:ip=....,port=...,state=...,offset=...,lag=... information of master about slave x, there can be multiple line like this, but the index of a slave should be consistent between calls
    Things to consider:
  • Should we still use text based protocol and read line by line
  • Should these information be displayed in external info command exposed to user's client, or keep it as an internal command
@axblueblader
Copy link
Member

  • Currently slave doesn't health check master so 'master_link_status' and 'master_link_down_since_seconds' will require some work.
  • I'm implementing master to health check slave in Refactor protocol client code and add slave health checking #21 so 'connected_slaves' and 'slavex' can be available.
  • Writing on slave in master-slave mode is not implemented yet as well. Currently if write command is sent to slave then it only change on that slave.
  • Partial sync is not implemented yet so there's no 'slave_repl_offset'.
  • The INFO command can be refactor to be a JSON string or any easy to serialize format.
  • I'm still hesitant to split to internal command for now unless it's really needed.

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

No branches or pull requests

2 participants