It can be found that the primary node IP in the first group of slots is empty. (The next time you execute this command, you find that the data is normal, not the Redis cluster problem)
The description of this part in the Redis document is as follows.
redis cluster-slots
However, it is found that there is no non-empty judgment in our source code, resulting in incorrect updated slot information.When the next access hits the slot, the following error message will be generated:
pipeline commit failed while connecting to :0
The IP information of slot is lost.
I think it is necessary to add non-empty judgment to expose error information in advance.
...
-- generate new list of servers
if sub_info[3][1] == nil or #sub_info[3][1] <= 0 then
return nil, "failed to fetch slots, slots_info[".. n .."] config is empty"
end
...
https://github.com/steve0511/resty-redis-cluster/blob/e080402bb29f7ab0d00dd81f1bdfb43037bd204a/lib/resty/rediscluster.lua#L142
Hello, when the slot is retrieved, the Redis cluster slots command returns a null value, for example:
It can be found that the primary node IP in the first group of slots is empty. (The next time you execute this command, you find that the data is normal, not the Redis cluster problem)
The description of this part in the Redis document is as follows. redis cluster-slots
However, it is found that there is no non-empty judgment in our source code, resulting in incorrect updated slot information.When the next access hits the slot, the following error message will be generated:
The IP information of slot is lost.
I think it is necessary to add non-empty judgment to expose error information in advance.
We look forward to your reply.