Skip to content

Spring-data-redis - Keyspace events and cleaning indexes in Redis cluster [DATAREDIS-1229] #1789

Open
@spring-projects-issues

Description

@spring-projects-issues

Ajilkumar opened DATAREDIS-1229 and commented

Application is running with spring-boot 2.3.1 and lettuce 5.3.1 with Redis Cluster enabled.

On Startup application is subscribing to expired events to the master node on the Redis Cluster. Upon Key expiry application is receiving Key expired event through which Index records are removed. This is working fine for single application instance connected to single master/slave cluster setup.

Problems faced with multiple instances of the application with more than 1 master/slave setup:

  1. When multiple instances of the application is running, then all of them are subscribing to the expired event and all are getting expired Key notification. The first instance getting this notification is cleaning the index and Phantom copy for that key. But all other instances trying to do the same duplicate work even though records are already removed. 
  2. During runtime when there is a cluster topology change(i,e new master elected due to failover Or master added newly) application is not subscribing to the new master even though cluster topology refresh is enabled. Due to which expired events are not received from these masters and index records are orphaned without cleanup.

From the documentations we are seeing that enabling keyspace events with Redis Cluster is not recommended. But is there anyway to cleanup orphaned index records without subscribing to these events?


No further details from DATAREDIS-1229

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions