From 8feff3e587c05658f5c9ccab3decb12208decc71 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 5 Dec 2018 14:33:48 +0000 Subject: [Minor] Skip broken slaves retrieved from sentinel Issue: #2667 --- lualib/lua_redis.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lualib') diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index 0c6520e5c..658e26242 100644 --- a/lualib/lua_redis.lua +++ b/lualib/lua_redis.lua @@ -137,9 +137,11 @@ local function redis_query_sentinel(ev_base, params, initialised) ) for _,slave in ipairs(master.slaves) do - read_servers_tbl[#read_servers_tbl + 1] = string.format( - '%s:%s', slave.ip, slave.port - ) + if slave['master-link-status'] == 'ok' then + read_servers_tbl[#read_servers_tbl + 1] = string.format( + '%s:%s', slave.ip, slave.port + ) + end end end -- cgit v1.2.3