The Redis command reference for EXPIRE
says:
Redis keys are expired in two ways: a passive way, and an active way.
A key is passively expired simply when some client tries to access it, and the key is found to be timed out.
Does passive expiration block the client command which triggered the expiration?
For example, imagine I have a massive ZSET containing M entries.
If I delete the ZSET using a DEL
command, the operation has time complexity of O(M), and will potentially block for a long time while the ZSET is deleted.
If the ZSET is instead scheduled for deletion via an EXPIRE
command, I'd assume Redis at some point needs to perform a similar O(M) delete operation.
Does that O(M) deletion happen inline with (and therefore block) the client command which attempted to access the ZSET's key and hence triggered the passive expiration?
If not, does it have any other blocking implications for the main Redis event loop?