add redis reconnect support when a master switch is detected