djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

Changing the behavior of writing to volatile keys #289

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The current behavior of resetting volatile keys on writes creates a huge 
inconvenience, making setnx locks (that expire incase of crash), and expiring 
atomic counters impossible.

Since redis uses an lazy expiration algorithm, it is possible to simply log the 
deletion of expired keys to the AOF, thus allowing volatile keys to preserve 
their values on changes.

The example provided on the Expire Command wiki

SET a 100
EXPIRE a 5
... wait 10 seconds ...
INCR a

in the AOF, it will be

SET a 100
DEL a
INCR a

and the expected behavior is preserved.

Original issue reported on code.google.com by iluvhy...@gmail.com on 20 Jul 2010 at 9:57

GoogleCodeExporter commented 8 years ago
without a functioning expire system, you cant really call redis memcached on 
steroids.

Original comment by iluvhy...@gmail.com on 20 Jul 2010 at 10:02

GoogleCodeExporter commented 8 years ago
This is now fixed in Redis master, anyway, let's call Redis just Redis :)

Cheers,
Salvatore

Original comment by anti...@gmail.com on 30 Aug 2010 at 2:00