Quick revision
The short answer
Lettuce reads the cluster's slot map when it connects and, unless topology refresh is enabled, never reads it again. After the resharding it keeps sending commands for moved slots to their old owners, follows a MOVED redirect every time, and refuses to connect to the new primaries because they are not in its cached view. We fix it by enabling adaptive and periodic topology refresh, through spring.data.redis.lettuce.cluster.refresh.adaptive and .period in Spring Boot or ClusterTopologyRefreshOptions in plain Lettuce, keeping dynamic refresh sources on and listing several seed nodes.
What to remember
In this answer, we saw that Lettuce caches the slot map at startup and, with refresh off by default, keeps sending commands to old owners after a reshard, following MOVED every time and refusing connections to nodes it does not know. Enabling adaptive and periodic topology refresh, keeping dynamic refresh sources on and listing several seeds fixes it, and a reshard test against a real cluster, watching MOVED rates, proves the configuration before production.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Lettuce reads the cluster's slot map when it connects and, unless topology refresh is enabled, never reads it again. After the resharding it keeps sending commands for moved slots to their old owners, follows a MOVED redirect every time, and refuses to connect to the new primaries because they are not in its cached view. We fix it by enabling adaptive and periodic topology refresh, through spring.data.redis.lettuce.cluster.refresh.adaptive and .period in Spring Boot or ClusterTopologyRefreshOptions in plain Lettuce, keeping dynamic refresh sources on and listing several seed nodes.
Why this question is asked
Redis Cluster is designed to change shape while running: we add primaries and move hash slots to them without downtime. That only works if every client notices the change. Interviewers ask this question because a client that does not notice works, slowly and with odd errors, which makes the cause hard to see. In this answer, we will recap how a cluster client routes commands, explain why this service kept hitting old owners, configure topology refresh in Spring Boot and in plain Lettuce, and see how to verify it during the next reshard.
1A Quick Recap of Slots and Redirects
Redis Cluster splits the keyspace into 16,384 hash slots. Each key belongs to one slot, computed as CRC16 of the key modulo 16,384, and each slot is owned by one primary. A cluster-aware client keeps a copy of the slot map, which slot belongs to which node, so it can send each command straight to the right node.
When a slot moves to another node, the old owner answers commands for it with a MOVED error that names the new owner, for example MOVED 3999 10.0.0.7:6379. During the move itself, it may answer ASK, meaning try the other node for this one command. A good client follows the redirect and updates its slot map, so the next command for that slot goes straight to the new owner.
2Why This Service Kept Hitting Old Owners
Lettuce follows MOVED redirects for the command that received them, but by default it does not update its cached slot map in response. Topology refresh, both periodic and adaptive, is off by default in Lettuce. So after slots moved from six primaries to nine, every command for a moved slot went to the old owner first, got MOVED, and was retried on the new owner. That doubled the round trips for a third of the keyspace, which explains the steady stream of redirects and the higher latency.
The error about a connection point not known in the cluster view comes from a safety check. By default Lettuce only connects to nodes that appear in its own topology view, so that a redirect to an unexpected address cannot send traffic somewhere unknown. The three new primaries were not in the stale view, so redirects to them were refused. Other services had refresh enabled, read the new topology, and never noticed.
6 messages in order. Play them, or step through them one at a time.
Without refresh, the client never learns about node 8.
3Enabling Topology Refresh in Spring Boot
Spring Boot exposes the two refresh modes as properties. Adaptive refresh re-reads the topology when the client sees signs of change; periodic refresh re-reads it on a timer.
Notice that we list several seed nodes. The seeds are used for the first connection; if the configuration lists only one and that node was removed during a reshard, a restarting service cannot even start. With dynamic refresh sources on, Lettuce asks every node it knows about for the topology rather than only the seeds, so it discovers new nodes and agrees with the majority view.
4The Same in Plain Lettuce
Without Spring Boot, we set the same options on the cluster client. In Spring Boot we can also pass these options through a LettuceClientConfigurationBuilderCustomizer if we need finer control, such as choosing specific adaptive triggers.
The two modes cover different cases. Adaptive refresh reacts quickly to changes that cause errors, like the MOVED stream here. Periodic refresh catches changes that cause no errors at all, such as a new replica that the client should use for reads when ReadFrom is set to replicas, or a failed-over primary whose old address still accepts connections. Which triggers exist and their names can change between Lettuce versions, so check your version.
5Verifying It and Choosing the Period
After the change, we watch the MOVED rate and per-node connection counts during the next reshard. With refresh enabled, MOVED errors should appear briefly while slots move and then fall to zero, and connections should appear to the new primaries.
The period should not be too short. Each refresh makes every client instance query the cluster for its topology, which with dynamic sources means a CLUSTER NODES style query to every node. With 300 pods refreshing every second, the cluster would answer thousands of topology queries per second. Thirty to sixty seconds for the period, with adaptive refresh for fast reactions, is a common balance.
6Follow-up questions
How would you catch this in a test before production?
Run an integration test against a real multi-node cluster in containers, for example with Testcontainers. The test starts the service, writes keys across many slots, then reshards: adds a node and moves slots to it with redis-cli --cluster reshard or CLUSTER SETSLOT. It then keeps reading and asserts that errors stay at zero and that, after a short time, no MOVED redirects occur. A service without topology refresh fails this test immediately, and the same test catches regressions after client upgrades.
Why does Lettuce refuse to connect to nodes outside its view?
It is a protection: a redirect could otherwise point the client at any address, including one that is not part of the cluster. The check is controlled by validateClusterNodeMembership in ClusterClientOptions. Turning it off hides the symptom; enabling refresh fixes the cause.
Does Jedis have the same problem?
Jedis's cluster client renews its slot cache when it receives MOVED, so it recovers on its own, though versions differ in how they do it. Lettuce simply makes the behaviour configurable and leaves it off by default, which is why this setting belongs in every service's configuration.
7Conclusion
In this answer, we saw that Lettuce caches the slot map at startup and, with refresh off by default, keeps sending commands to old owners after a reshard, following MOVED every time and refusing connections to nodes it does not know. Enabling adaptive and periodic topology refresh, keeping dynamic refresh sources on and listing several seeds fixes it, and a reshard test against a real cluster, watching MOVED rates, proves the configuration before production.
Open with
The service's Lettuce client is running with a stale slot map. Lettuce reads the cluster topology when it connects, and by default it does not refresh it, neither on a timer nor when it sees redirects.
Then, if they want more
After the cluster went from six to nine primaries, commands for moved slots still went to the old owners, which answered MOVED, and Lettuce followed the redirect each time. That is the steady MOVED stream and the extra latency.
The error about a connection point not known in the cluster view is Lettuce's membership check: it refuses to connect to nodes that are not in its cached view, and the new primaries were not. The fix is to enable topology refresh.
In Spring Boot I set spring.data.redis.lettuce.cluster.refresh.adaptive to true and refresh.period to something like 30 seconds; in plain Lettuce, ClusterTopologyRefreshOptions with enableAllAdaptiveRefreshTriggers and enablePeriodicRefresh. Adaptive refresh reacts to MOVED, ASK and repeated reconnects; periodic refresh catches changes that cause no errors, such as new replicas for read routing. I keep dynamic refresh sources on and list several seed nodes.
I would not make the period very short, since every instance queries every node on each refresh, and I would watch MOVED rates during the next reshard to confirm it.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Redis documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What is wrong with this service's client configuration, and how do you configure it for...": https://scrivio-interview-library.netlify.app/databases/redis-scaling/00c373d471/