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

Lettuce compatibility with Redis Server #2350

Closed
davide-capozzi opened this issue Mar 7, 2023 · 6 comments
Closed

Lettuce compatibility with Redis Server #2350

davide-capozzi opened this issue Mar 7, 2023 · 6 comments
Labels
for: stackoverflow A question that is better suited to stackoverflow.com

Comments

@davide-capozzi
Copy link

davide-capozzi commented Mar 7, 2023

I need to upgrade a redis 5.x cluster which is shared between a lot of apps which are using different lettuce versions, is there any resource available to understand each released lettuce version compatibility with the redis server?

For example the latest RELEASE-NOTE for 6.2 says:

Lettuce 6 supports Redis 2.6+ up to Redis 7.x. In terms of Java runtime, Lettuce requires at least Java 8 and works with Java 18.

But in 6.1 it was saying:

Lettuce 6 supports Redis 2.6+ up to Redis 6.x. In terms of Java runtime, Lettuce requires at least Java 8 and works with Java 16.

I'm a bit confused here, does it mean i need lettuce 6.2 to be compatible with a redis 7.x server or is any 6.x lettuce client enough?

In my specific use case i was able to figure out the apps actually use 3 lettuce versions:

  • 6.1.10.RELEASE
  • 6.1.8.RELEASE
  • 5.1.8.RELEASE

Now the RELEASE-NOTE for 5.1.8 doesn't say anything about the compatibility with the redis server, can anyone help me out here? given these 3 clients what is the maximum redis version i can safely upgrade to?

@mp911de
Copy link
Collaborator

mp911de commented Mar 7, 2023

Basically: Lettuce is compatible with all Redis versions above Redis 2.6.

By the time Lettuce 6.1 was released, Redis 6.2 was just out, Redis 7.0 was released about a year later. We add the upper bound as an indication that we've ran our test suite against the mentioned Redis version.

@davide-capozzi
Copy link
Author

thanks @mp911de for explaining, if i understand it correctly this means i can assume 5.1.8 is tested and compatible with the redis version that was available at the time it was released, but there is no real guarantee it will work with 7.x?

@mp911de
Copy link
Collaborator

mp911de commented Mar 7, 2023

What can occasionally happen is that individual commands in Redis server were updated and you don't get to use all sorts of flags or arguments of a command. Other than that, you should be good.

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
@mp911de mp911de added the for: stackoverflow A question that is better suited to stackoverflow.com label Mar 7, 2023
@coolbeevip
Copy link
Contributor

What can occasionally happen is that individual commands in Redis server were updated and you don't get to use all sorts of flags or arguments of a command. Other than that, you should be good.

As you've pointed out, the HELLO command [1] is only compatible with Redis versions 6.0 and later, thus making a connection to earlier Redis versions unachievable.

[1] https://github.com/lettuce-io/lettuce-core/blob/87a75e6255dd908f261a31fd60d8ef5a90a68dbc/src/main/java/io/lettuce/core/RedisHandshake.java#L225

Would it be possible for us to address some compatibility issues here, if it's not too much trouble?

@mp911de
Copy link
Collaborator

mp911de commented Oct 26, 2023

Regarding HELLO, you Lettuce tries to auto-discover the protocol. You can pin the Redis version to a fixed one (RESP2/RESP3). In RESP2 mode, HELLO isn't used at all.

In any case, happy to hear if you run into any incompatibilities that we can sort out.

@coolbeevip
Copy link
Contributor

Regarding HELLO, you Lettuce tries to auto-discover the protocol. You can pin the Redis version to a fixed one (RESP2/RESP3). In RESP2 mode, HELLO isn't used at all.

In any case, happy to hear if you run into any incompatibilities that we can sort out.

I appreciate your guidance. Changing the protocol to RESP2 resolved the issue I was encountering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that is better suited to stackoverflow.com
Projects
None yet
Development

No branches or pull requests

3 participants