RPOP/LPOP with a count return a bulk string instead of an array when one element is left
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
Research direction
Start at Garnet’s RPOP and LPOP command handling and the tests for list pop commands; the issue does not name specific files. Reproduce the one-element case with a count and compare its RESP reply with the two-element case. Done means count-form replies are arrays, including a one-element result, and a missing key returns null.
Written by the indexing model from the issue text.
Description
Describe the bug
RPOP key count and LPOP key count must always reply with an array when count is given. Garnet returns a bare bulk string when the list holds one element, so the reply type depends on the list length. Clients that parse the count form as an array fail on that reply.
Steps to reproduce the bug
RPUSH one x => :1
RPOP one 2 => $1 x (bulk string)
RPUSH two x y => :2
RPOP two 5 => *2 y x (array, as expected)
RPUSH one x => :1
LPOP one 2 => $1 x (bulk string)
Expected behavior
As in Redis 6.2+ (RPOP): with count, the reply is an array, so RPOP one 2 on a one-element list returns *1\r\n$1\r\nx\r\n. A missing key returns a null reply.
Release version
v2.2.5 (ghcr.io/microsoft/garnet:2.2.5, default options). Also seen on v2.1.8.
IDE
Not applicable. Commands sent over a raw TCP connection.
OS version
Docker on Windows 11 (Linux container).
Additional context
Found while running the integration suite of Respire, a .NET Redis client, against Garnet. I could not find an existing issue or pull request for this.
- Dominant language
- C#
- Stars
- 12.1k
- Forks
- 716
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 65
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/garnet
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
GEOADD updating a member's position keeps the member's old TTL, so the new position is silently deletedMay be free again @Saad-elnagar claimed this 9 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
microsoft/garnet#2265 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 2 days
-
Blocking pops with a short timeout can time out and reply nil although a key has elementsPossibly taken @badrishc claimed this 7 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 2 days
All issues in microsoft/garnet
Similar issues
-
bug effort:S P3
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
nightscout/nocturne#3093 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100