redis/tests/unit/moduleapi
debing.sun 0cb1ee0dc1
New eviction policies - least recently modified (#14624)
### Summary

This PR introduces two new maxmemory eviction policies: `volatile-lrm`
and `allkeys-lrm`.
LRM (Least Recently Modified) is similar to LRU but only updates the
timestamp on write operations, not read operations. This makes it useful
for evicting keys that haven't been modified recently, regardless of how
frequently they are read.

### Core Implementation

The LRM implementation reuses the existing LRU infrastructure but with a
key difference in when timestamps are updated:

- **LRU**: Updates timestamp on both read and write operations
- **LRM**: Updates timestamp only on write operations via `updateLRM()`

### Key changes:
Add `keyModified()` to accept an optional `robj *val` parameter and call
`updateLRM()` when a value is provided. Since `keyModified()` serves as
the unified entry point for all key modifications, placing the LRM
update here ensures timestamps are consistently updated across all write
operations

---------

Co-authored-by: oranagra <oran@redislabs.com>
Co-authored-by: Yuan Wang <yuan.wang@redis.com>
2026-01-06 20:57:31 +08:00
..
aclcheck.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
async_rm_call.tcl Remove unnecessary skip:external for module tests (#14354) 2025-09-28 17:09:50 +03:00
auth.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
basics.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
blockedclient.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
blockonbackground.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
blockonkeys.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
cluster.tcl Fix CI flaky tests (#14531) 2025-11-19 17:10:57 +08:00
cmdintrospection.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
commandfilter.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
configaccess.tcl Fix numeric config boundry check (#14286) 2025-10-28 13:40:44 +02:00
crash.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
datatype.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
datatype2.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
defrag.tcl Introduce DEBUG_DEFRAG compilation option to allow run test with activedefrag when allocator is not jemalloc (#14326) 2025-09-10 12:52:20 +08:00
eventloop.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
fork.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
getchannels.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
getkeys.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
hash.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
hooks.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
infotest.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
infra.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
internalsecret.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
keyspace_events.tcl Remove unnecessary skip:external for module tests (#14354) 2025-09-28 17:09:50 +03:00
keyspecs.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
list.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
mallocsize.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
misc.tcl New eviction policies - least recently modified (#14624) 2026-01-06 20:57:31 +08:00
moduleauth.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
moduleconfigs.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
postnotifications.tcl Remove unnecessary skip:external for module tests (#14354) 2025-09-28 17:09:50 +03:00
propagate.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
publish.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
rdbloadsave.tcl Introduce DEBUG_DEFRAG compilation option to allow run test with activedefrag when allocator is not jemalloc (#14326) 2025-09-10 12:52:20 +08:00
reply.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
scan.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
stream.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
subcommands.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
test_lazyfree.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
testrdb.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
timer.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
usercall.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00
zset.tcl Run module tests as part of the base redis testsuit (#14226) 2025-08-26 14:49:05 +03:00