From 8b485b6020e3715145282f87936c23584677681e Mon Sep 17 00:00:00 2001 From: Stephen Kinser Date: Mon, 25 Mar 2024 17:18:30 -0600 Subject: [PATCH] Doc cautions about index repo with Redis Cluster Due to https://github.com/spring-projects/spring-data-redis/issues/1111, applications can suffer from missing important Keyspace events as described at https://github.com/spring-projects/spring-session/issues/2230. This adds a caution to the docs to help others avoid running into this problem and suggests an alternative. Mitigates #2230. --- spring-session-docs/modules/ROOT/pages/configuration/redis.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc b/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc index 1020dd36..0869d5c8 100644 --- a/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc +++ b/spring-session-docs/modules/ROOT/pages/configuration/redis.adoc @@ -122,6 +122,8 @@ For example, it may create indexes based on session attributes like user ID or l These indexes allow for efficient querying of sessions based on specific criteria, enhancing performance and enabling advanced session management features. In addition to that, `RedisIndexedSessionRepository` also supports session expiration and deletion. +CAUTION: When using `RedisIndexedSessionRepository` with Redis Cluster you must be aware that https://github.com/spring-projects/spring-data-redis/issues/1111[it only subscribe to events from one random redis node in the cluster], which can cause some session indexes not being cleaned up if the event happened in a different node. + === Configuring the `RedisSessionRepository` ==== Using Spring Boot Properties