kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

A large negative EXPIRE keeps the key instead of deleting it

Open quiet-maple-47 opened this issue 1 month ago • 1 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

Version

apache/kvrocks:nightly-20261014-d690353, Linux arm64

Minimal reproduce step

On a local test instance at port 6666, with redis-cli:

k="upstream-repro-$(date +%s)-$$"
r() { redis-cli -p 6666 "$@"; }
r SET "$k" v
r EXPIRE "$k" -2000000000
r GET "$k"

What did you expect to see?

The key should be deleted, as with any non-positive EXPIRE timeout in Redis.

What did you see instead?

EXPIRE returns 1 but GET returns v. The negative timeout puts the deadline before 1970.

Anything Else?

Tested on 2026-10-14. This is about the negative timeout, not the timing-dependent EXPIRE 0 case.

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

quiet-maple-47 avatar Oct 15 '26 00:10 quiet-maple-47

Hi, I’d like to give this issue a try. I’ll look into the cause and see if I can add a regression test. Thank u!

yaolele05 avatar Oct 15 '26 12:10 yaolele05