Repository navigation
Cannot determine a partition for slot #2252
Copy link
Copy link
Closed as not planned
Description
Bug Report
Current Behavior
During certain redis operations, I am facing PartitionSelectorException.
Stack trace
Caused by: io.lettuce.core.cluster.PartitionSelectorException: Cannot determine a partition for slot 12004.
at io.lettuce.core.cluster.PooledClusterConnectionProvider.getWriteConnection(PooledClusterConnectionProvider.java:164)
at io.lettuce.core.cluster.PooledClusterConnectionProvider.getConnectionAsync(PooledClusterConnectionProvider.java:149)
at io.lettuce.core.cluster.ClusterDistributionChannelWriter.doWrite(ClusterDistributionChannelWriter.java:170)
at io.lettuce.core.cluster.ClusterDistributionChannelWriter.write(ClusterDistributionChannelWriter.java:103)
at io.lettuce.core.RedisChannelHandler.dispatch(RedisChannelHandler.java:218)
at io.lettuce.core.cluster.StatefulRedisClusterConnectionImpl.dispatch(StatefulRedisClusterConnectionImpl.java:216)
at io.lettuce.core.AbstractRedisAsyncCommands.dispatch(AbstractRedisAsyncCommands.java:676)
at io.lettuce.core.AbstractRedisAsyncCommands.get(AbstractRedisAsyncCommands.java:960)
at sun.reflect.GeneratedMethodAccessor425.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.lettuce.core.cluster.ClusterFutureSyncInvocationHandler.handleInvocation(ClusterFutureSyncInvocationHandler.java:122)
at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
at com.sun.proxy.$Proxy254.get(Unknown Source)
at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.get(LettuceStringCommands.java:68)Input Code
Code Configuration
ClusterTopologyRefreshOptions topologyRefreshOptions = ClusterTopologyRefreshOptions.builder()
.enablePeriodicRefresh(Duration.ofSeconds(30))
.enableAllAdaptiveRefreshTriggers()
.build();
ClientOptions options = ClusterClientOptions.builder()
.disconnectedBehavior(ClientOptions.DisconnectedBehavior.REJECT_COMMANDS)
.autoReconnect(true)
.topologyRefreshOptions(topologyRefreshOptions)
.build();
GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig();
genericObjectPoolConfig.setMinIdle(8);
genericObjectPoolConfig.setMaxIdle(16);
genericObjectPoolConfig.setMaxTotal(16);
LettucePoolingClientConfiguration.builder()
.poolConfig(genericObjectPoolConfig)
.clientOptions(options)
.clientResources(clientResources)
.build();Expected behavior/code
Environment
- Lettuce version(s): [6.1.5.RELEASE]
- Redis version: [5.0.6]
- Shards: 6
- Number of nodes: 12
Analysis
Redis cluster is healthy, all the metrics are as expected.
So, could give me some suggestions. Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
mp911de commentedon Nov 22, 2022
This happens if
CLUSTER NODESdoesn't report a master node for the intended slot.mandeepjain commentedon Nov 25, 2022
Found the issue fixed here:
#2178
@mp911de I guess it was a bug in older versions