Open gauravgarg-dev opened 1 year ago
When using Redis Cluster with MGET and keys across multiple slots, then Lettuce partitions the given keys across slots and issues multiple MGET
calls to assemble the final response then.
These kinds of issues are hard to reproduce locally. You can find the code for key partitioning in RedisAdvancedClusterAsyncCommandsImpl.mget(…)
. I would ask you to run the code with a debugger attached to investigate at what point the key gets lost and whether you use duplicate keys (e.g. a key multiple times).
@mp911de we enabled pipelining to fetch the exact data pattern with single GET calls and combined to get the result. We are always getting the data. What could the reason for this behaviour with MGET ?
@mp911de we enabled pipelining to fetch the exact data pattern with single GET calls and combined to get the result. We are always getting the data. What could the reason for this behaviour with MGET ?
Are you still having this issue? Could you clarify what you mean by "we enabled pipelining to fetch the exact data pattern with single GET"?
Bug Report
We are using Lettuce-core 6.1.8 along spring boot redis 2.7.0. We have configured cluster redis on redis labs with 32 shards.
In the rest call we get 100 Product to query from Redis. We have added slot in PID to combine 100 Mget into few of 10s for optimisation. Example keys looks like {15502}.op:pso-99760635-462532. Where 15502 is generated via
Code to Fetch data
While making mget to redis we have observed that, If we query 50 keys along with let say above key , We are getting result of 49 and 1 data is missed in the result intermittently . While key exist in redis but sometime result is not correct. But if we query single in MGET , we are always getting the result in redis-cli and rest API.
To test this further we added pipelining to fetch the data but with GET calls and combined to get the result. We are always getting the data with pipelining. But with mget , data is missed intermittently
Current Behavior
Stack trace
```java // your stack trace here; ```Input Code
Input Code
```java public Long getKeyBasedOnSlot(Long slotV) { try { return (slotV / 1024) % 16384; } catch (Exception e) { log.error("Exception while getting slot", e); } return null; } private ListExpected behavior/code
Environment
Possible Solution
Additional context