REDIS DELETE不会删除密钥

发布于 2025-01-23 10:02:50 字数 1232 浏览 0 评论 0原文

在我的redis数据库中,我有一个钥匙:

127.0.0.1:6379[5]> get "263384DB-61DD561800016316-240C0700"

"{\"json\":{\"created\":\"1641895448090335\",\"last_signal\":\"1641895448\",\"tos\":\"184\",\"deleted\":\"0\",\"num_sfds\":\"4\",\"num_streams\":\"4\",\"num_medias\":\"2\",\"num_tags\":\"2\",\"num_maps\":\"2\",\"ml_deleted\":\"0\",\"created_from\":
... about 6300 chars

我尝试了

127.0.0.1:6379[5]> del "263384DB-61DD561800016316-240C0700"

(integer) 1

我也尝试了:

127.0.0.1:6379[5]> DEL `"263384DB-61DD561800016316-240C0700"`

Invalid argument(s)

127.0.0.1:6379[5]> DEL '"263384DB-61DD561800016316-240C0700"'

(integer) 0

但是价值仍然存在:

127.0.0.1:6379[5]> get "263384DB-61DD561800016316-240C0700"

"{\"json\":{\"created\":\"1641895448090335\",\"last_signal\":\"1641895448\",\"tos\":\"184\",\"deleted\":\"0\",\"num_sfds\":\"4\",\"num_streams\":\"4\",\"num_medias\":\"2\",\"num_tags\":\"2\",\"num_maps\":\"2\",\"ml_deleted\":\"0\",\"created_from\"
... about 6300 chars

TTL为24小时,但是钥匙已有20天或更长时间了。什么原因是什么?

现在,我还尝试了

UNLINK "263384DB-61DD561800016316-240C0700"
(integer) 1

钥匙仍然存在。

In my redis database I have a key:

127.0.0.1:6379[5]> get "263384DB-61DD561800016316-240C0700"

"{\"json\":{\"created\":\"1641895448090335\",\"last_signal\":\"1641895448\",\"tos\":\"184\",\"deleted\":\"0\",\"num_sfds\":\"4\",\"num_streams\":\"4\",\"num_medias\":\"2\",\"num_tags\":\"2\",\"num_maps\":\"2\",\"ml_deleted\":\"0\",\"created_from\":
... about 6300 chars

I try

127.0.0.1:6379[5]> del "263384DB-61DD561800016316-240C0700"

(integer) 1

I also tried:

127.0.0.1:6379[5]> DEL `"263384DB-61DD561800016316-240C0700"`

Invalid argument(s)

127.0.0.1:6379[5]> DEL '"263384DB-61DD561800016316-240C0700"'

(integer) 0

but value is still there:

127.0.0.1:6379[5]> get "263384DB-61DD561800016316-240C0700"

"{\"json\":{\"created\":\"1641895448090335\",\"last_signal\":\"1641895448\",\"tos\":\"184\",\"deleted\":\"0\",\"num_sfds\":\"4\",\"num_streams\":\"4\",\"num_medias\":\"2\",\"num_tags\":\"2\",\"num_maps\":\"2\",\"ml_deleted\":\"0\",\"created_from\"
... about 6300 chars

TTL is 24 hours, but key is 20 or more days old. What could be the reason?

Now I also tried

UNLINK "263384DB-61DD561800016316-240C0700"
(integer) 1

key still exists.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一袭白衣梦中忆 2025-01-30 10:02:50

我不确定为什么您在运行后继续尝试删除密钥:

server:6379> del "263384DB-61DD561800016316-240C0700"

并获得以下成功的结果:

(integer) 1

为了调试它,启动另一个终端会话并运行Redis的Monitor命令:

redis-cli MONITOR

然后您可以看到所有命令都进入了Redis。

另外,尝试在原始会话中运行此操作,以查看键的“ lime live live” ,无论是在尝试删除密钥之前和之后:

server:6379> ttl "263384DB-61DD561800016316-240C0700"

I am not sure why you continue trying to delete your key after you run:

server:6379> del "263384DB-61DD561800016316-240C0700"

and get a successful result of:

(integer) 1

In order to debug it, start another Terminal session and run Redis's MONITOR command:

redis-cli MONITOR

then you can see all the commands coming into Redis.

Also, try running this in your original session, to see the key's "Time-to-Live", both before and after attempting to delete the key:

server:6379> ttl "263384DB-61DD561800016316-240C0700"
百善笑为先 2025-01-30 10:02:50

马克的评论很有帮助。它接缝钥匙每5秒再次写入一次:(每隔几秒钟查询一次)
127.0.0.1:6379 [5]> TTL“ 263384DB-61DD561800016316-240C0700”(INTEGER)86395 127.0.0.0.1:6379 [5]> TTL“ 263384DB-61DD561800016316-240C0700”(INTEGER)86399 127.0.0.0.1:6379 [5]> TTL“ 263384DB-61DD561800016316-240C0700”(Integer)86398 127.0.0.0.1:6379 [5]> TTL“ 263384DB-61DD561800016316-240C0700”(Integer)86398 127.0.0.0.1:6379 [5]> TTL“ 263384DB-61DD561800016316-240C0700”(Integer)86398 127.0.0.0.1:6379 [5]> TTL“ 263384DB-61DD561800016316-240C0700”(INTEGER)86395 127.0.0.0.1:6379 [5]> TTL“ 263384DB-61DD561800016316-240C0700”(INTEGER)86397 127.0.0.0.1:6379 [5]> ttl“ 263384DB-61DD561800016316-240C0700”(Integer)86400

来自Redis-Cli监视器:

1651147523.327082 [5 “ 86400” 1651147528.326984 [5 127.0.0.1:53408]“设置”“ 263384DB-61DD561800016316-240C0700”“” {{\“ JSON \”:{\“ create \”:{\“ create \”:\“ 164189544809544809090335

...是编写密钥的软件(RTP引擎)

Comment from Mark was helpful. It seams the key is written again every 5 seconds: (Query every few seconds)
127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86395 127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86399 127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86398 127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86398 127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86398 127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86395 127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86397 127.0.0.1:6379[5]> ttl "263384DB-61DD561800016316-240C0700" (integer) 86400

from redis-cli MONITOR:

1651147523.327082 [5 127.0.0.1:53408] "EXPIRE" "263384DB-61DD561800016316-240C0700" "86400" 1651147528.326984 [5 127.0.0.1:53408] "SET" "263384DB-61DD561800016316-240C0700" "{\"json\":{\"created\":\"1641895448090335...

so this is not a REDIS issue, it is the software writing the keys (rtp engine)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文