We use this code to connect to HA Redis, create/subscribe a PUBSUB channel and read out the published message:
local sub = assert(redis_conf.redis_connector:connect()) local _, err = sub:subscribe(redis_conf.channel) ... local bytes, error = sub:read_reply()
When testing on a HA Redis failover scenario, the existing PUBSUB channels are gone when the master Redis goes down. We were expecting the PUBSUB channel with the same name would be created and subscribed automatically by lua-resty-redis-connector in the newly promoted master node, but it didn't happen.
Is this something lua-resty-redis-connector handles? Or our code needs to explicitly handle this failure scenario?
Hi, sorry for taking forever to respond. Yes, this is something your code will need to handle. The connector's job is to make it easier to you to establish connections, nothing more.
We use this code to connect to HA Redis, create/subscribe a PUBSUB channel and read out the published message:
local sub = assert(redis_conf.redis_connector:connect()) local _, err = sub:subscribe(redis_conf.channel) ... local bytes, error = sub:read_reply()
When testing on a HA Redis failover scenario, the existing PUBSUB channels are gone when the master Redis goes down. We were expecting the PUBSUB channel with the same name would be created and subscribed automatically by
lua-resty-redis-connector
in the newly promoted master node, but it didn't happen.Is this something
lua-resty-redis-connector
handles? Or our code needs to explicitly handle this failure scenario?Thanks.