RMapCache listener call twice
Expected behavior
The map entry listener should only call once When invoke RMapCache#put method.
I found that if use single server, there will be no problem. But when configured in cluster mode, the listener will call twice.
Actual behavior
The map entry listener call twice.
Steps to reproduce or test case
- Clone the reidsson source code.
- Execute unit test
RedissonMapCacheTest#testCreatedListener - Before step2 , should create redisson server instance with cluster mode.
Redis version
4.0.14
Redisson version
The latest version
Redisson configuration
Config config = new Config();
config.useClusterServers()
.addNodeAddress("redis://xxxx", "redis://xxxx", "redis://xxxx");
This is a bug on Redis side. I opened corresponding issue https://github.com/antirez/redis/issues/6575
I have the same issue and do some debug.
Don't know why yet, but it seems that the issue cause by the first if block in the Lua script of MapCacheEvictionTask (which is used to prevent script from being run simultaneously).
Remove the first if statement does eliminate the duplication
Unable to reproduce it with 3.15.1 version
The problem that RMapCache listener call twice still exists in version 3.20.1
Redisson configuration: Three masters and three slaves
@SpartaHao
Is there any code to reproduce it?
@SpartaHao
3.21.2 has a fix which may resolve it. Can you try it as well?
Fixed - Pattern Topic messages are missed/duplicated after failover in cluster if channel starts with __keyspace and __keyevent and subscriptionMode = SLAVE