-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RMapCache Cache expiration not working correctly on a cluster of Redisson clients #5634
Comments
Unable to reproduce. Below is the code example: for (int i = 0; i < 10; i++) {
int j = i;
RedissonClient rr = Redisson.create(r.getConfig());
RMapCache<String, String> tt2 = rr.getMapCache("test");
tt2.addListener(new EntryExpiredListener<String, String>() {
@Override
public void onExpired(EntryEvent<String, String> event) {
System.out.println("expired" + j + " " + event);
}
});
}
RMapCache<String, String> tt = r.getMapCache("test");
tt.addListener(new EntryExpiredListener<String, String>() {
@Override
public void onExpired(EntryEvent<String, String> event) {
System.out.println("expired " + event);
}
});
tt.put("1", "2", 1, TimeUnit.SECONDS);
Thread.sleep(10000); log output:
|
@mrniko PUBSUB SHARDNUMSUB redisson_map_cache_expired:{cacheName} results in 1 |
@mrniko , It seems like the issue is at When the Redisson is initialized in multiple JVMs, few of the pods fail to detect whether Sharding is supported and end up subscribing to RedissonTopic instead of RedissonShardedTopic. I Implmented the RedissonClient interface and copied the required code from Redisson class and I forcefully set the sharding support as true in the SubscribeService and After that it's working as expected. |
…MapCache and RLocalCachedMap objects. #5634
Thanks for providing more details. Slave nodes reply with MOVED error. Fixed now. |
We are using AWS ElastiCache 7.0.7 with cluster mode enabled. We have 2 master and 2 slave nodes.
We are connecting adding an expiry listener to RMapCache from multiple microservices in a statefulset in Kubernetes.
Expected behavior
We expect all the pods to receive the expired messages.
Actual behavior
Only few of the pods receive the expired messages.
Steps to reproduce or test case
Add expiry listener to RMapCache with same name across multiple pods and print the expired messages.
Push some data in the cache with a timeout.
Check if all the pods are getting the expiry events.
Redis version
ElastiCache 7.0.7 with clustering
Redisson version
3.26.1
Redisson configuration
The text was updated successfully, but these errors were encountered: