Skip to content

Slave does not become master if original master never showed up or both restart #1073

@alexfouche

Description

@alexfouche

Hi,

I have to scenarios where Sentinel does not promote a master. Some might say that this could be an akward situation that should not happen, but when in the cloud IAAS, it can happen rather frequently. For example instances go down, or reprovisionned. Or simply when your app and redis replicaset is started only a few hours of the day or intermittently. Whatever the reason, when the whole set of servers is started, Redis replicaset should be operational even if the redis-server which is master in its configuration does not show up for various reasons.

Below are 2 scenarios to reproduce the case

My setup is 2x redis servers, and 3x sentinels, on 3 different servers.

I am using the lastest redis-server from branch 2.6, currently at commit antirez@34a57a5

Scenario 1:

  • there are 2 redis servers configured as master slave, namely redis1 and redis2. They are not started
  • there are 3 sentinels that are running fine
  • i start redis2 which has slaveof redis1 in its configuration

-> BAD: sentinels do not promote redis2 to master

Scenario 2:

  • there are 2 redis servers configured as master slave, namely redis1 and redis2. They are not started
  • there are 3 sentinels that are running fine
  • i start redis1 which is master in its configuration. It shows up as master
  • i start redis2 which has slaveof redis1 in its configuration. It shows up as a slave and begins syncing
  • i stop redis1
  • sentinels promote redis2 to master, as expected
  • i stop redis2
  • i start redis2. It tries to sync but redis1 is still down

-> BAD: sentinels do not promote redis2 to master. The difference with scenario1 is that sentinels had the history and saw the topology of the redis replicaset, when both redis1 and redis2 were running, but they did not take it into account to promote redis2 as master.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions