Silk0vsky
Silk0vsky

Reputation: 1032

What about redis EVAL atomicity regarding keys with TTL?

As I know redis is single threaded solution from client point of view. But what about the general architecture?

Amuse we have some lua script that going to execute several commands on keys that has some TTL. How does redis garbage collections works? Could it interrupt the EVAL execution & evict some value or internal tasks share the single thread with user tasks?

Upvotes: 0

Views: 443

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 49942

Lua is majik, and because that is the case time stops when Redis is doing Lua. Put differently, expiration stops once you start running the script in the sense that time does not advance. However, if a key expired before the script started, it will not be available for the script to use.

Upvotes: 2

Related Questions