Notice that my zrangebylex is losing track of "abc" depending on what the score is.

Starting off at 1, then changing to 0, 1 (back to 1), or 2 in this ticket's example still finds it. Changing to 3-6 in the example is losing it.

$ ./redis-cli -v
redis-cli 4.0.11
127.0.0.1:6379> zadd test 1 abc
(integer) 1
127.0.0.1:6379> zadd test 2 def
(integer) 1
127.0.0.1:6379> zadd test 3 xyz
(integer) 1
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
1) "abc"
127.0.0.1:6379> zadd test 1 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
1) "abc"
127.0.0.1:6379> zadd test 4 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
(empty list or set)
127.0.0.1:6379> zadd test 1 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
1) "abc"
127.0.0.1:6379> zadd test 0 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
1) "abc"
127.0.0.1:6379> zadd test 2 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
1) "abc"
127.0.0.1:6379> zadd test 3 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
(empty list or set)
127.0.0.1:6379> zadd test 4 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
(empty list or set)
127.0.0.1:6379> zadd test 5 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
(empty list or set)
127.0.0.1:6379> zadd test 6 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
(empty list or set)
127.0.0.1:6379> zadd test 2 abc
(integer) 0
127.0.0.1:6379> zrangebylex test "[abc" "[abc"
1) "abc"
127.0.0.1:6379> 

Comment From: RyanBard

Note: I just confirmed the same behavior in 5.0.5.

Comment From: itamarhaber

Hello @RyanBard

This isn't an issue - as stated in the top of the docs (emphasis mine):

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering,

Comment From: RyanBard

Ah, I didn't understand your quoted part and overlooked the "If the elements in the sorted set have different scores, the returned elements are unspecified." under it.

I'm closing the ticket.