On max_attempts to 2 ,if the active Redis master down, will to crash redis-proxy
atrun opened this issue · comments
Marlon Li commented
run command "shutdown" in redis-cli of Master.
console show debug info:
debug: Pinging 192.168.80.92:6379
debug: Pinging 192.168.80.83:6379
debug: Pinging 192.168.80.83:6380
debug: End on the redis connection received clearning the connection
debug: releaseing[object Object]
info: end happened
{ host: '192.168.80.92', port: 6379 }
error: Main server down PANIC
info: finding next active server.
debug: Creating the pool for active server6379
info: 192.168.80.83:6379 is slave of no one
info: Marking 192.168.80.92:6379 as slave of 192.168.80.83:6379
info: Marking 192.168.80.83:6380 as slave of 192.168.80.83:6379
info: Setting up as active 192.168.80.83 : 6379
Error: Redis connection gone from end event.
debug: End on the redis connection received clearning the connection
debug: releaseing[object Object]
debug: End on the redis connection received clearning the connection
debug: releaseing[object Object]
debug: End on the redis connection received clearning the connection
debug: releaseing[object Object]
debug: End on the redis connection received clearning the connection
debug: releaseing[object Object]
debug: End on the redis connection received clearning the connection
debug: releaseing[object Object]
Reply: OK
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Redis connection to 192.168.80.92:6379 failed - connect ECONNREFUSED
at RedisClient.on_error (/home/hadoop/redis/sreeix-redis-proxy-1.3/node_modules/redis/index.js:136:24)
at Socket.<anonymous> (/home/hadoop/redis/sreeix-redis-proxy-1.3/node_modules/redis/index.js:70:14)
at Socket.emit (events.js:67:17)
at Array.0 (net.js:301:14)
at EventEmitter._tickCallback (node.js:192:40)
Note: view slave info , a slave has switched to master. that is to say ,“one of the slave it randomly pieked slave as master.”, the operation was a success.
Marlon Li commented
[ sreeix-redis-proxy-d93a730.zip ] , this version exists the problem.
Sreekanth commented
Nice catch, I did not even know SHUTDOWN command existed. Will post a fix. (And a better exception management scheme, than crashing and dying)
Marlon Li commented
Ok. This bug fixed. thanks.