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

unable to connect to Google Memorystore #3837

Closed
jasonschroeder-sfdc opened this issue May 11, 2024 · 4 comments
Closed

unable to connect to Google Memorystore #3837

jasonschroeder-sfdc opened this issue May 11, 2024 · 4 comments

Comments

@jasonschroeder-sfdc
Copy link

jasonschroeder-sfdc commented May 11, 2024

Expected behavior

I'd like to use Jedis Cluster mode to connect to a MemoryStore Redis Cluster

Actual behavior

ClassCastException when parsing the reply from CLUSTER SHARDS command.

java.lang.ClassCastException: class [B cannot be cast to class java.lang.Long ([B and java.lang.Long are in module java.base of loader 'bootstrap')                                                                                 
    at redis.clients.jedis.BuilderFactory$57.build(BuilderFactory.java:1011)                                                                                                                                                        
    at redis.clients.jedis.BuilderFactory$57.build(BuilderFactory.java:1000)                                                                                                                                                        
    at redis.clients.jedis.BuilderFactory.createMapFromDecodingFunctions(BuilderFactory.java:1787)                                                                                                                                  
    at redis.clients.jedis.BuilderFactory.createMapFromDecodingFunctions(BuilderFactory.java:1761)                                                                                                                                  
    at redis.clients.jedis.BuilderFactory.access$100(BuilderFactory.java:16)                                                                                                                                                        
    at redis.clients.jedis.BuilderFactory$59.build(BuilderFactory.java:1090)                                                                                                                                                        
    at redis.clients.jedis.BuilderFactory$59.build(BuilderFactory.java:1064)                                                                                                                                                        
    at redis.clients.jedis.Jedis.clusterShards(Jedis.java:8840)                                                                        

It seems that the response from Google Memorystore cannot be deserialized here

The reply from redis-cli indicates these are not what's documented?

localhost:6379> CLUSTER SHARDS
1) 1) "slots"
   2) 1) "10923"   <-- Redis doc says they should be (integer)?
      2) "16383"   <-- Redis doc says they should be (integer)?
   3) "nodes"
   4) 1)  1) "id"
          2) "6d173e8ca045e8c531b61d0e9980acb63c8b8485"
          3) "port"
          4) (integer) 11004
          5) "tls-port"
          6) (integer) 11004
          7) "ip"
          8) "10.x.x.x" ----REDACTED----
          9) "endpoint"
         10) "10.x.x.x" ----REDACTED----
         11) "role"
         12) "master"
         13) "replication-offset"
         14) (integer) 2366
         15) "health"
         16) "online"

The documentation seems to indicate that the slots should be (integer)?

Steps to reproduce:

Please create a reproducible case of your problem. Make sure
that case repeats consistently and it's not random

  1. Provision Google Memorystore Redis Cluster without Replication and TLS enabled (In-transit encryption) - https://cloud.google.com/memorystore/docs/cluster
  2. Point Jedis at the Discovery Endpoint. https://cloud.google.com/memorystore/docs/cluster/connect-cluster-instance
  3. Convince JVM to not check Memorystore self-signed certificate

Redis / Jedis Configuration

GCP Memorystore Redis Cluster

Jedis version:

Jedis 5.1.2

Redis version:

Memorystore Redis Cluster

Java version:

Azul Openjdk 17

@sazzad16
Copy link
Collaborator

sazzad16 commented May 11, 2024

JedisCluster is not dependent on CLUSTER SHARDS command (yet). Ref: #2985

@sazzad16 sazzad16 closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
@jasonschroeder-sfdc
Copy link
Author

@sazzad16 - Thank you for triaging so quickly!

Are you saying that the Jedis.clusterShards() method is known to be broken? I am calling that in my code and getting the ClassCastException.

@sazzad16
Copy link
Collaborator

Are you saying that the Jedis.clusterShards() method is known to be broken?

Nothing that I am aware of.
Moreover, we have never received such bug report.

I am calling that in my code and getting the ClassCastException.

As you've already mentioned, the reply is not according to redis documentation which is the base for Jedis implementation. We cannot help in such cases.

@aishukamal
Copy link

For posterity, I want to confirm that we, Google Memorystore, will be fixing this incompatibility issue on our end soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants