I have 3 box setup of redis sentinel:
CLIENT (connects to S1)
|
↓
+----+
| M1 | us-east-1
| S1 |
+----+
|
+----+ | +----+
| R2 |----+----| R3 |
| S2 | | S3 |
+----+ +----+
us-east-2 us-west-2
M1 - Master
S1 - Sentinel 1
S2 - Sentinel 2
S3 - Sentinel 3
R2 - First slave (R=replica)
R3 - Second slave
After my master died, sentinel made a failover to R2. I brought back M1 online (cleared some disk space) and now M1 is alive and well but a slave of R2. Is there an automatic way (or semi-automatic) to make M1 a master again and R2 as a slave of M1 and my traffic again using M1 as a master redis instance?
Essentially I want to revert to how it was prior to failover.
What currently happens is that it elects R2 as a master and reconfigures it to be:
CLIENT (connects to S1)
|
↓
+----+
|[R2]| us-east-2
| S2 |
+----+
|
+----+ | +----+
|[M1]|----+----| R3 |
| S1 | | S3 |
+----+ +----+
us-east-1 us-west-2
When I failover manually, it promotes R3 as master. (which is kind of expected).
But then when I failover again manually, it promotes R2, but I would expect it to promote M1.
All successive failovers rotate between R2 and R2 (while always keeping M1 as a slave of either).
My M1 slave priority is unspecified, so it means it's a default value of 100. My R2 slave priority is 200 and R2 is 300. That leads me to think that it should rotate all 3 of the boxes, but it rotates only R2 and R3 after the initial failover.
This looks like a sentinel bug to me