Skip to content
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

Keyspace Events in Redis Cluster get lost [DATAREDIS-534] #1111

Open
spring-projects-issues opened this issue Jul 18, 2016 · 2 comments
Open
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

Mark Paluch opened DATAREDIS-534 and commented

Keyspace notifications in Redis Cluster are published only to the local node (see redis/redis#2541. Keyspace notifications are not broadcasted to all nodes).

Spring Data Redis subscribes only to one (random) node and so the expiry event may be received but that depends on which node the subscription resides and on which cluster node a key expired.

The recommended workaround is to:

  1. Subscribe to all master nodes
  2. Periodically check for topology changes
  3. Handle (merge) events on the client

Affects: 1.7.2 (Hopper SR2)

Issue Links:

  • DATAREDIS-1123 Clustered Redis keyspace notifications are only received from one node in a cluster
    ("is duplicated by")
  • DATAREDIS-1213 Spring-data-redis - Not subscribing to all master nodes
    ("is duplicated by")

2 votes, 3 watchers

@kinsersh
Copy link
Contributor

kinsersh commented Mar 13, 2024

I'm seeing this same issue as reported with spring-projects/spring-session#2230. In my use case, it negatively affects Spring Authorization Server when using SpringSessionBackedSessionRegistry with a sharded redis where the authorization server's token endpoint ends up reading every session including the expired ones in the principal index. The expired sessions stack up which linearly increases the token endpoint latency.

kinsersh added a commit to kinsersh/spring-data-redis that referenced this issue Mar 25, 2024
Due to spring-projects#1111, applications can suffer from missing important Keyspace events.

This adds a caution to the docs to help others avoid running into this problem.
kinsersh added a commit to kinsersh/spring-data-redis that referenced this issue Mar 25, 2024
Due to spring-projects#1111, applications can suffer from missing important Keyspace events as described at spring-projects/spring-session#2230.

This adds a caution to the docs to help others avoid running into this problem.
kinsersh added a commit to kinsersh/spring-data-redis that referenced this issue Mar 25, 2024
Due to spring-projects#1111, applications can suffer from missing important Keyspace events as described at spring-projects/spring-session#2230.

This adds a caution to the docs to help others avoid running into this problem.
kinsersh added a commit to kinsersh/spring-data-redis that referenced this issue Mar 25, 2024
Due to spring-projects#1111, applications can suffer from missing important Keyspace events as described at spring-projects/spring-session#2230.

This adds a caution to the docs to help others avoid running into this problem.
kinsersh added a commit to kinsersh/spring-data-redis that referenced this issue Mar 26, 2024
Due to spring-projects#1111, applications can suffer from missing important Keyspace events as described at spring-projects/spring-session#2230.

This adds a caution to the docs to help others avoid running into this problem.
kinsersh added a commit to kinsersh/spring-data-redis that referenced this issue Mar 26, 2024
Applications can suffer from missing important Keyspace events as described at spring-projects/spring-session#2230.

This adds a caution to the docs to help others avoid running into this problem.

Related ticket spring-projects#1111
marcusdacoregio pushed a commit to spring-projects/spring-session that referenced this issue May 13, 2024
Due to spring-projects/spring-data-redis#1111, applications can suffer from missing important Keyspace events as described at #2230.

This adds a caution to the docs to help others avoid running into this problem and suggests an alternative.

Mitigates #2230.
@sureshkmit
Copy link

sureshkmit commented Nov 4, 2024

Any update on this issue? This is a blocker for us. We used Redis Repository pattern with search capabilities without knowing about this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants