gulaftab / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

BRPOPLPUSH and a single LPUSH with several items doesn't work well together #656

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is in the unstable branch (but possibly in the other ones too). Try doing 
the following on a clean Redis instance (in this order):

1. Client A blocks on 'BRPOPLPUSH a b 0'
2. Client B runs 'LPUSH a data1 data2 data3'

Result: 'a' is empty and 'b' contains only "data1". AOF and replication shows 
the same.

The reason is that rpoplpushHandlePush calls rewriteClientCommandVector when 
the first item is pushed to 'a' and that interferes with the pushing of the 
other items. Even if pushGenericCommand was changed so that it would push all 
the items regardless (using a local copy of them), the replication and AOF 
would only register one of the items. This seems to require some minor redesign 
to fix it.

Everything works when BRPOPLPUSH isn't involved, of course.

Original issue reported on code.google.com by hampus.w...@gmail.com on 7 Sep 2011 at 6:55

GoogleCodeExporter commented 9 years ago
THanks Hampus, this is also present in 2.4 AFAIK, fixing it, and reporting back 
here in this open issue.

Original comment by anti...@gmail.com on 12 Sep 2011 at 2:18

GoogleCodeExporter commented 9 years ago
https://github.com/antirez/redis/issues/87

Original comment by pcnoordh...@gmail.com on 18 Jan 2012 at 4:22