Skip to content

4.0.0rc1 breaks various zrange commands on older servers #1669

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

Closed
bmerry opened this issue Nov 7, 2021 · 4 comments · Fixed by #1670 or #1697
Closed

4.0.0rc1 breaks various zrange commands on older servers #1669

bmerry opened this issue Nov 7, 2021 · 4 comments · Fixed by #1670 or #1697
Assignees
Labels
bug Bug

Comments

@bmerry
Copy link
Contributor

bmerry commented Nov 7, 2021

Version: redis-py 4.0.0rc1, redis 6.0.16 (or any less than 6.2).

Platform: Python 3.8, Ubuntu 20.04

Description:

Previously calling zrevrange or zrange(..., desc=True) would use ZREVRANGE on the wire. Somewhere between 4.0.0b1 and 4.0.0rc1 this changed to use ZRANGE ... REV, which is new syntax in Redis 6.2. When using an older server this causes a syntax error.

To reproduce:

import redis
r = redis.Redis('localhost')
r.zrevrange('foo', 0, -1)

Other commands are also affected e.g. zrangebyscore and zrangebylex are also using ZRANGE with options on the wire which is not supported pre-6.2.

@bmerry bmerry changed the title 4.0.0rc1 breaks zrevrange on older servers 4.0.0rc1 breaks various zrange commands on older servers Nov 7, 2021
@bmerry
Copy link
Contributor Author

bmerry commented Nov 7, 2021

@chayim looks like this was broken by #1603.

@chayim
Copy link
Contributor

chayim commented Nov 8, 2021

Thanks @bmerry for tracking this down all the way. We'll definitely get this into rc2! @AvitalFineRedis while we're here, let's test for this case.

@bmerry
Copy link
Contributor Author

bmerry commented Nov 9, 2021

@chayim the following is still broken in 4.0.0rc2 (but worked in 3.5.3):

import redis
r = redis.Redis('localhost')
r.zrange('foo', 0, -1, desc=True)

@chayim chayim reopened this Nov 9, 2021
@chayim
Copy link
Contributor

chayim commented Nov 9, 2021

@AvitalFineRedis can you add a test with this specific case? Our 6.0.0 testing didn't seem to cover this.

@bmerry thanks again, for highlighting this.

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