Created
April 13, 2014 01:21
-
-
Save huangzworks/10564625 to your computer and use it in GitHub Desktop.
在复制模式下,如果主服务器不向从服务器显式地发送 DEL 命令以删除过期键,那么这个过期键会一直滞留在从服务器里面,尽管它已经过期了。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1:12345> TTL key # 尚未过期 | |
(integer) 3 | |
127.0.0.1:12345> TTL key | |
(integer) 1 | |
127.0.0.1:12345> TTL key # 虽然键已经过期,但因为我阻塞住了主服务器, | |
(integer) 0 # 而主服务器没办法向从服务器发送 DEL 命令,所以值会一直滞留在从服务器里面。 | |
127.0.0.1:12345> GET key | |
"value" | |
127.0.0.1:12345> TTL key | |
(integer) 0 | |
127.0.0.1:12345> GET key | |
"value" | |
127.0.0.1:12345> TTL key | |
(integer) 0 | |
127.0.0.1:12345> GET key | |
"value" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
赞个!