djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

Enabling VM with a large dataset causes BLPOP/BRPOP failures #259

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Running git master (d5096a28d79bc8e0c015). When I run a Redis instance with VM 
*disabled*, BLPOP/BRPOP work as expected. However, when I run a Redis instance 
with VM enabled, BLPOP/BRPOP occasionally will wait for the timeout and return 
a null value even though there are more values in the list(s). Using redis-cli:

redis> select 9
OK
redis> rpush foo a
(integer) 1
redis> rpush foo b
(integer) 2
redis> rpush foo c
(integer) 3
redis> rpush foo d
(integer) 4
redis> lrange foo 0 -1
1. "a"
2. "b"
3. "c"
4. "d"
redis> blpop foo 1
1. "foo"
2. "a"
redis> blpop foo 1
1. "foo"
2. "b"
redis> blpop foo 1
(nil)                                 # <----- SHOULD BE "c"
redis> blpop foo 1
1. "foo"
2. "c"                               # <----- There's "c"
redis> blpop foo 1
(nil)                                 # <----- And no "d"....
redis> blpop foo 1
(nil)
redis> blpop foo 1
(nil)
redis> blpop foo 1
(nil)
redis> blpop foo 1
(nil)
redis> blpop foo 1
(nil)
redis> blpop foo 1
(nil)
redis> blpop foo 1
(nil)
redis> blpop foo 1
1. "foo"
2. "d"                                # <----- all the way down here... ???     

Original issue reported on code.google.com by sed...@gmail.com on 15 Jun 2010 at 8:31

GoogleCodeExporter commented 8 years ago
Actually, this may have nothing to do with VM being turned on. I'm seeing the 
same behavior with VM turned off, although less frequently.

Original comment by sed...@gmail.com on 15 Jun 2010 at 8:40

GoogleCodeExporter commented 8 years ago
I've replicated this behavior. Will update with a fix later tonight.

Original comment by pcnoordh...@gmail.com on 15 Jun 2010 at 6:32

GoogleCodeExporter commented 8 years ago
Fix is available at: http://github.com/pietern/redis/tree/blpop-test
Could you merge this manually to see whether this fixes the issue for you? 
Thanks!

Original comment by pcnoordh...@gmail.com on 15 Jun 2010 at 7:25

GoogleCodeExporter commented 8 years ago
Seems like this did in fact fix the problem. :)

Original comment by sed...@gmail.com on 15 Jun 2010 at 7:54

GoogleCodeExporter commented 8 years ago
Good to hear! Closing the issue.

Original comment by pcnoordh...@gmail.com on 26 Jun 2010 at 9:49