开发者

Redis delayed keys add

开发者 https://www.devze.com 2023-04-11 12:10 出处:网络
I have 3 virtual machines vm1, vm2 and redis-server all connected to each other. Various processes on vm2, invoke RPCs in vm1. But the parameters to the RPCs are stored in Redis. vm2 passes the key t

I have 3 virtual machines vm1, vm2 and redis-server all connected to each other.

Various processes on vm2, invoke RPCs in vm1. But the parameters to the RPCs are stored in Redis. vm2 passes the key to the parameters to vm1. vm1 fetches the corresponding value (i.e. parameters) and executes the call. Most of the time it works perfectly.

However, sometimes I see that vm1 cannot fetch value belonging to key sent by vm2. After a short while, I see that the key-value is added to the redis-server.

I looked through the redis config file to figure out if some option is causing this. Also searched some docum开发者_JS百科entation. However, I have no idea why this is happening.

Would anyone know why this is happening and a solution to this problem?


There isn't much detail here so this is mostly a stab in the dark. However, I'd look to see if you are using asynchronous (i.e. non-blocking) calls when setting the data into the redis-server. It is possible that with async calls you can send the key to the vm2 before you actually set the data in redis-server.

As to how to determine that, it depends on what libraries you are using to interface with Redis.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号