Repository navigation
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit ac634ee. Configure here.
agarwalbharat
force-pushed
the
feature/jediscluster-public-renew-slot-cache
branch
from
June 2, 2026 19:07
491a718 to
80bfbf4
Compare
Collaborator
|
Thanks @agarwalbharat - One naming change before merge. Rename the public It refreshes the full topology (nodes + primary/replica slots), not just a slot cache, and it matches the existing /**
* Forces an immediate refresh of the in-memory Redis Cluster topology
* (node map, primary and replica slot assignments).
* <p>
* Useful before {@link #getConnectionFromSlot(int)} when stale topology is
* detected outside the command retry path. Best-effort; a no-op if a refresh
* is already in progress.
*/
public void refreshClusterTopology() {
((ClusterConnectionProvider) provider).renewSlotCache();
}Same on both Thanks again! |
Add JedisCluster#refreshClusterTopology() as a public API that delegates to the existing ClusterConnectionProvider renewal path. This gives applications an explicit way to refresh the in-memory cluster slot cache when they detect stale topology state outside the normal command retry flow.
agarwalbharat
force-pushed
the
feature/jediscluster-public-renew-slot-cache
branch
from
June 3, 2026 07:21
80bfbf4 to
1bcab78
Compare
Contributor
Author
|
Thank you @ggivo for the review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Jedis already supports refreshing the Redis Cluster slot cache internally through
ClusterConnectionProvider.renewSlotCache(), but callers directly using do not have a public API to trigger that refresh directly.This is useful for applications that detect stale or incomplete cluster topology state outside the normal command retry path, especially for direct slot/node workflows such as
getConnectionFromSlot().Add
JedisCluster#refreshClusterTopology()as a public API that delegates to the existingClusterConnectionProviderrenewal path.This gives applications an explicit way to refresh the in-memory cluster slot cache when they detect stale topology state outside the normal command retry flow.
Closes : #4154
Note
Low Risk
Thin public wrapper over existing renewal logic; no new topology algorithm, only broader caller access to a path already used internally.
Overview
Adds
refreshClusterTopology()onJedisClusterandRedisClusterClient, exposing a way for apps to force an in-memory cluster topology refresh (nodes and slot map) by delegating to the existingClusterConnectionProvider#renewSlotCache()path—intended when stale routing is noticed outside normal command retries, e.g. beforegetConnectionFromSlot(int).Unit tests assert both clients call
renewSlotCache()on the provider (mockedJedisClusterconstructor andRedisClusterClientbuilder).Reviewed by Cursor Bugbot for commit 1bcab78. Bugbot is set up for automated code reviews on this repo. Configure here.