mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 00:52:38 +00:00
0ffb9d2ea9
Redis 7.2 (#9406) introduced a new modules event, `RedisModuleEvent_Key`. This new event allows the module to read the key data just before it is removed from the database (either deleted, expired, evicted, or overwritten). When the key is removed from the database, either by active expire or eviction. The new event was not called as part of an execution unit. This can cause an issue if the module registers a post notification job inside the event. This job will not be executed atomically with the expiration/eviction operation and will not replicated inside a Multi/Exec. Moreover, the post notification job will be executed right after the event where it is still not safe to perform any write operation, this will violate the promise that post notification job will be called atomically with the operation that triggered it and **only when it is safe to write**. This PR fixes the issue by wrapping each expiration/eviction of a key with an execution unit. This makes sure the entire operation will run atomically and all the post notification jobs will be executed at the end where it is safe to write. Tests were modified to verify the fix. |
||
---|---|---|
.. | ||
aclcheck.c | ||
auth.c | ||
basics.c | ||
blockedclient.c | ||
blockonbackground.c | ||
blockonkeys.c | ||
cmdintrospection.c | ||
commandfilter.c | ||
datatype2.c | ||
datatype.c | ||
defragtest.c | ||
eventloop.c | ||
fork.c | ||
getchannels.c | ||
getkeys.c | ||
hash.c | ||
hooks.c | ||
infotest.c | ||
keyspace_events.c | ||
keyspecs.c | ||
list.c | ||
Makefile | ||
mallocsize.c | ||
misc.c | ||
moduleauthtwo.c | ||
moduleconfigs.c | ||
moduleconfigstwo.c | ||
postnotifications.c | ||
propagate.c | ||
publish.c | ||
rdbloadsave.c | ||
reply.c | ||
scan.c | ||
stream.c | ||
subcommands.c | ||
test_lazyfree.c | ||
testrdb.c | ||
timer.c | ||
usercall.c | ||
zset.c |