Created
July 23, 2015 11:57
-
-
Save itamarhaber/d2664c0ce3cad9860b9f to your computer and use it in GitHub Desktop.
What happens to volatile keys when loading from RDB in Redis?
This file contains hidden or 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
foo@bar:~$ redis-cli | |
127.0.0.1:6379> flushall | |
OK | |
127.0.0.1:6379> save | |
OK | |
127.0.0.1:6379> set p persistent | |
OK | |
127.0.0.1:6379> set v volatile | |
OK | |
127.0.0.1:6379> expire v 99999999 | |
(integer) 1 | |
127.0.0.1:6379> ttl v | |
(integer) 99999997 | |
127.0.0.1:6379> save | |
OK | |
127.0.0.1:6379> shutdown | |
not connected> exit | |
foo@bar:~$ sudo service redis_6379 start | |
[sudo] password for foo: | |
Starting Redis server... | |
foo@bar:~$ redis-cli | |
127.0.0.1:6379> dbsize | |
(integer) 2 | |
127.0.0.1:6379> ttl p | |
(integer) -1 | |
127.0.0.1:6379> ttl v | |
(integer) 99999956 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment