kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

TTL reports an existing key after HDEL removes the last field

Open quiet-maple-47 opened this issue 1 month ago • 2 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 HSET "$k" f v
r HDEL "$k" f
r EXISTS "$k"
r TTL "$k"

What did you expect to see?

TTL -2 because the key no longer exists, as in Redis.

What did you see instead?

EXISTS returns 0 but TTL returns -1.

Anything Else?

No response

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 investigate why TTL returns -1 after the last hash field is deleted and add a regression test. Thank u!

yaolele05 avatar Oct 15 '26 12:10 yaolele05

Hi, is anyone still working on this? I'd be happy to take it if not.

DeviousDrops avatar Nov 09 '26 11:11 DeviousDrops