Repository navigation
Description
It seems that the client-reconfig-script in redis-sentinel notify in the wrong order (first "end" then "start"). Below you'll find the output of a dummy script i use to record the parameters given by the sentinel when a failover occurs.
It records the timestamp + nanosecond when the script was called and the origin caller (either notification or client-reconfig script).
1370866662-688276622 [NOTIFICATION SCRIPT] /tmp/test.sh +sdown sentinel 10.0.0.193:24000 10.0.0.193 24000 @ instanceRedisTest 10.0.0.188 6400
1370866662-978657855 [NOTIFICATION SCRIPT] /tmp/test.sh -sdown sentinel 10.0.0.193:24000 10.0.0.193 24000 @ instanceRedisTest 10.0.0.188 6400
1370867067-868237393 [NOTIFICATION SCRIPT] /tmp/test.sh +sdown master instanceRedisTest 10.0.0.188 6400
1370867069-072231800 [NOTIFICATION SCRIPT] /tmp/test.sh +odown master instanceRedisTest 10.0.0.188 6400 #quorum 2/2
1370867069-172265246 [NOTIFICATION SCRIPT] /tmp/test.sh +failover-state-wait-start master instanceRedisTest 10.0.0.188 6400 #starting in 12165 milliseconds
1370867069-173129321 [NOTIFICATION SCRIPT] /tmp/test.sh +failover-triggered master instanceRedisTest 10.0.0.188 6400
1370867081-408114511 [NOTIFICATION SCRIPT] /tmp/test.sh +failover-state-select-slave master instanceRedisTest 10.0.0.188 6400
1370867081-508104325 [NOTIFICATION SCRIPT] /tmp/test.sh +selected-slave slave 10.0.0.193:6400 10.0.0.193 6400 @ instanceRedisTest 10.0.0.188 6400
1370867082-311383747 [NOTIFICATION SCRIPT] /tmp/test.sh +switch-master instanceRedisTest 10.0.0.188 6400 10.0.0.193 6400
1370867082-312773385 [CLIENT-RECONFIG SCRIPT] /tmp/test.sh instanceRedisTest leader end 10.0.0.188 6400 10.0.0.193 6400
1370867082-313443251 [CLIENT-RECONFIG SCRIPT] /tmp/test.sh instanceRedisTest leader start 10.0.0.188 6400 10.0.0.193 6400
1370867082-315793812 [NOTIFICATION SCRIPT] /tmp/test.sh +failover-state-reconf-slaves master instanceRedisTest 10.0.0.188 6400
1370867082-317036147 [NOTIFICATION SCRIPT] /tmp/test.sh +failover-end master instanceRedisTest 10.0.0.188 6400
1370867082-317663085 [NOTIFICATION SCRIPT] /tmp/test.sh +promoted-slave slave 10.0.0.193:6400 10.0.0.193 6400 @ instanceRedisTest 10.0.0.188 6400
1370867084-816079278 [NOTIFICATION SCRIPT] /tmp/test.sh +sdown slave 10.0.0.188:6400 10.0.0.188 6400 @ instanceRedisTest 10.0.0.193 6400
I'm using Redis server v=2.6.13 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64
My config file:
port 24000
sentinel monitor instanceRedisTest 10.0.0.188 6400 2
sentinel down-after-milliseconds instanceRedisTest 2500
sentinel failover-timeout instanceRedisTest 5000
sentinel can-failover instanceRedisTest yes
sentinel parallel-syncs instanceRedisTest 2
pidfile /srv/redis/sentinel/run/redis_sentinel1.pid
dir /srv/redis/sentinel
logfile /srv/redis/sentinel/logs/sentinel1.log
sentinel client-reconfig-script instanceRedisTest /tmp/test.sh
sentinel notification-script instanceRedisTest /tmp/test.sh
daemonize yes
Activity
ljluestc commentedon Mar 9, 2025
Deflake test Primary COB growth with inactive replica (redis#1165)