[redis]github-87 Report
https://github.com/antirez/redis/issues/87
BRPOPLPUSH doesn’t behave correctly when blocked on empty list. It will return wrong result.
Client A blocks on 'BRPOPLPUSH a b 0'
Client B runs 'LPUSH a data1 data2 data3'
The correct result should be A returns with “a” = [data1 data2] and “b” = [data3], but the wrong result was ‘a’ empty and ‘b’ = [data1]
Critical
No
No
Single client
2.4.unstable
standard
Client A blocks on 'BRPOPLPUSH a b 0'
Client B runs 'LPUSH a data1 data2 data3'
in this order
Yes
Yes. client log
3
Wrong result.
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.
Semantic
No