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

Cannot determine a partition for slot #2252

Closed
mandeepjain opened this issue Nov 16, 2022 · 2 comments
Closed

Cannot determine a partition for slot #2252

mandeepjain opened this issue Nov 16, 2022 · 2 comments
Labels
for: read-the-documentation An issue that can be easily solved by reading the reference documentation or Javadoc

Comments

@mandeepjain
Copy link

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!

@mp911de
Copy link
Collaborator

mp911de commented Nov 22, 2022

This happens if CLUSTER NODES doesn't report a master node for the intended slot.

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2022
@mp911de mp911de added the for: read-the-documentation An issue that can be easily solved by reading the reference documentation or Javadoc label Nov 22, 2022
@mandeepjain
Copy link
Author

Found the issue fixed here:
#2178

@mp911de I guess it was a bug in older versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: read-the-documentation An issue that can be easily solved by reading the reference documentation or Javadoc
Projects
None yet
Development

No branches or pull requests

2 participants