News for hackers. Stuff that matters.
Re:Redis scripts do not expire keys atomically by WJW on Thursday January 27, 2022 @09:44AM (#30101143)
I'm pretty sure they aren't ordered. Redis active key expiry is a random process: https://redis.io/commands/expire#how-redis-expires-keys. TL;DR: Redis will randomly sample the keyspace and delete any expired keys it finds in the sample. If a large enough percentage of the sample was expired, it will repeat the process. Since the sample is random, it cannot be ordered.

There is also a "passive" key expiry where any read to a key will check the expiry time and delete the key if the current time is larger than the expiry time.

There are no comments on this comment yet.