Skip to content

sentinel add loading-as-pong option to shorter the unavailable time after master restart #4561

Description

@scenbuffalo

redis version:

4.0.2

problem:

In big-dataset scene, when the master restart in short time, sentinel think the master is available because master give "LOADING" as "PING"'s reply. the failover will not trigger because sentinel detect the restart of master, this will make service unavailable utill master finish the loading.

reproduce:

  1. 3 sentinels. 1 master + 1 slave, enable aof. client get the master info by sentinel.
  2. kill -9 redis master, then start the redis master.
  3. sentinel log: 1091433:X 13 Dec 20:03:42.712 * +reboot master mymaster 100.64.0.25 6379
  4. client get stuck by "Redis is loading the dataset in memory" because failover don't trigger.

In my test of 10GB dataset, client wait almost 200s during master restart.
client code: https://github.com/scenbuffalo/redis/blob/master/utils/cli_redis_stl.py

suggestion

add loading-as-pong option, see scenbuffalo@840df3c
In my test of 10GB dataset, the unavailable time will cut to down-after-milliseconds+2s if set loading-as-pong with no.
If it is necessary, I will make a PR. @antirez

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions