redisson icon indicating copy to clipboard operation
redisson copied to clipboard

RMapCache listener call twice

Open echooymxq opened this issue 7 years ago • 6 comments

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

  1. Clone the reidsson source code.
  2. Execute unit test RedissonMapCacheTest#testCreatedListener
  3. 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");

echooymxq avatar Nov 06 '19 17:11 echooymxq

This is a bug on Redis side. I opened corresponding issue https://github.com/antirez/redis/issues/6575

mrniko avatar Nov 13 '19 15:11 mrniko

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

nmquyet avatar Nov 29 '19 14:11 nmquyet

Unable to reproduce it with 3.15.1 version

mrniko avatar Mar 08 '21 11:03 mrniko

The problem that RMapCache listener call twice still exists in version 3.20.1

Redisson configuration: Three masters and three slaves

SpartaHao avatar Aug 03 '23 04:08 SpartaHao

@SpartaHao

Is there any code to reproduce it?

mrniko avatar Aug 03 '23 06:08 mrniko

@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

mrniko avatar Aug 03 '23 06:08 mrniko