question about sentinel pubsub messaging format

23 views
Skip to first unread message

David Geller

unread,
Sep 26, 2016, 12:33:13 PM9/26/16
to Redis DB
I have a master and two slaves, with four sentinels, three of them on the redis servers and one on a monitor server.

Last Friday, the master appears to have gotten sequestered temporarily and a new master was elected (as expected).  However, on the pubsub channel, I was expecting a +switch-master message but it didn't come.  I seem to be missing some understanding of the pub/sub format.  I'm trying to figure out how to parse these correctly so that I can take appropriate action.

According to the docs, it's
<instance-type> <name> <ip> <port> @ <master-name> <master-ip> <master-port>
In the below events,

10.20.11.140 goes from slave -> master
10.20.20.93 goes from master -> slave

what I got from the pubsub channel, is:

* +slave slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380
* -role-change slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380 new reported role is master
* +convert-to-slave slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380
* +role-change slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380 new reported role is slave

so... how I read the above is this:

1. +slave 10.20.11.140 is already a slave here and 10.20.20.93 is master.  don't understand this message
2. -role-change seems to say that 10.20.11.140 is now reported to be changing to master with the config still showing a discrepancy (great)
3. +convert-to-slave seems to be saying that 10.20.11.140 should convert to slave ??? with 10.20.20.93 still listed as master ???
4. +role-change (still showing slave) for 10.20.11.140 with 10.20.20.93 still seeming to be master and "new reported role is slave"  ??? I don't understand this at all.

All of these message appear to be referring to slave 10.20.11.140 with the master constantly 10.20.20.93.

If anyone can point me to the pubsub messaging docs, I would appreciate it.

This is the sentinel log and it makes sense to me and in fact, 10.20.11.140 became master and 10.20.20.93 became a slave.

10386:X 23 Sep 23:18:04.271 # +sdown master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:04.330 # +odown master connector 10.20.20.93 6380 #quorum 2/2
10386:X 23 Sep 23:18:04.330 # +new-epoch 64
10386:X 23 Sep 23:18:04.330 # +try-failover master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:04.335 # +vote-for-leader bdc519f1fb07cbe1cbc88096f88c70a55d6a1bea 64
10386:X 23 Sep 23:18:04.342 # 10.20.20.93:26380 voted for bdc519f1fb07cbe1cbc88096f88c70a55d6a1bea 64
10386:X 23 Sep 23:18:04.343 # 10.20.30.129:26380 voted for bdc519f1fb07cbe1cbc88096f88c70a55d6a1bea 64
10386:X 23 Sep 23:18:04.359 # 10.20.21.74:26379 voted for bdc519f1fb07cbe1cbc88096f88c70a55d6a1bea 64
10386:X 23 Sep 23:18:04.401 # +elected-leader master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:04.401 # +failover-state-select-slave master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:04.472 # +selected-slave slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:04.472 * +failover-state-send-slaveof-noone slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:04.563 * +failover-state-wait-promotion slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:05.375 # +promoted-slave slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:05.375 # +failover-state-reconf-slaves master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:05.449 * +slave-reconf-sent slave 10.20.30.129:6380 10.20.30.129 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:05.679 # -sdown master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:05.679 # -odown master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:05.737 * +slave-reconf-inprog slave 10.20.30.129:6380 10.20.30.129 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:35.379 # +failover-end-for-timeout master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:35.379 # +failover-end master connector 10.20.20.93 6380
10386:X 23 Sep 23:18:35.379 * +slave-reconf-sent-be slave 10.20.11.140:6380 10.20.11.140 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:35.379 * +slave-reconf-sent-be slave 10.20.30.129:6380 10.20.30.129 6380 @ connector 10.20.20.93 6380
10386:X 23 Sep 23:18:35.379 # +switch-master connector 10.20.20.93 6380 10.20.11.140 6380
10386:X 23 Sep 23:18:35.379 * +slave slave 10.20.30.129:6380 10.20.30.129 6380 @ connector 10.20.11.140 6380
10386:X 23 Sep 23:18:35.379 * +slave slave 10.20.20.93:6380 10.20.20.93 6380 @ connector 10.20.11.140 6380

Reply all
Reply to author
Forward
0 new messages