SET key value KEEPTTL deletes the key when it has a TTL and the new value does not fit in place
Maintainers usually reply within 2 days
Assessment
This issue has not been assessed yet.
Description
Describe the bug
SET key value KEEPTTL on a key that has an expiration replies +OK but removes the key when the new value needs more space than the existing record has. Afterwards EXISTS returns 0, TTL returns -2 and the key is no longer counted by DBSIZE.
Any client that updates a value with KEEPTTL to preserve its expiration can lose the key silently, because the reply is a success.
Steps to reproduce the bug
> SET k ab
OK
> EXPIRE k 120
1
> SET k abcdefgh KEEPTTL
OK
> EXISTS k
0
> TTL k
-2
> GET k
(nil)
> DBSIZE
0
Expected behavior
The key holds the new value and keeps its TTL. The same commands on Redis 8.6.1:
> SET k abcdefgh KEEPTTL
OK
> EXISTS k
1
> TTL k
120
> GET k
abcdefgh
Screenshots
No response
Release version
- Garnet 2.2.1,
ghcr.io/microsoft/garnet:2.2.1, default configuration, standalone - linux/arm64 (Linux 6.12.28)
- redis-cli 8.6.1
IDE
No response
OS version
No response
Additional context
No response
- Dominant language
- C#
- Stars
- 12.1k
- Forks
- 716
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 68
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
-
GEOADD updating a member's position keeps the member's old TTL, so the new position is silently deletedPossibly taken @Saad-elnagar claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
microsoft/garnet#2265 · 1 comment ·
Maintainers usually reply within 2 days
-
TsavoriteLog fast-commit recovery adopts a stale suffix after recovering and reusing the tailPossibly taken @TedHartMS claimed this 1 day ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/garnet#2299 · 1 reaction · 1 assignee ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Maintainers usually reply within 2 days
-
Lua scripts ignore SELECT and always run against database 0Possibly taken @kevin-montrose claimed this 7 days ago. Open
Difficulty 4/5 1-2 days Newbie friendliness 65/100
microsoft/garnet#2258 · 1 assignee ·
Maintainers usually reply within 2 days
-
INCR rejects a stored INT64_MIN valuePossibly taken @TedHartMS claimed this 12 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
microsoft/garnet#2246 · 1 assignee ·
Maintainers usually reply within 2 days
All issues in microsoft/garnet
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
:watch: Not Triaged advanced-concepts/subsvc dotnet-csharp/svc
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
[bug] Season images use the season's TMDB id as a TVDB series idPossibly taken @ViKodex claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
enhancement no-stack-trace
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
greenshot/greenshot#1618 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
microsoft/aspire.dev#1962 ·
Maintainers usually reply within 1 day