redis/tests/unit
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
..
cluster Fix adjacent slot range behavior in ASM operations (#14637) 2025-12-23 11:54:12 +03:00
moduleapi New eviction policies - least recently modified (#14624) 2026-01-06 20:57:31 +08:00
type Fix XTRIM/XADD with approx not deletes entries for DELREF/ACKED strategies (#14623) 2026-01-05 21:17:36 +08:00
acl-v2.tcl Fix Read/Write key pattern selector (CVE-2024-51741) 2025-01-13 21:20:19 +02:00
acl.tcl Free current client asynchronously after user permissions changes (#13274) 2024-05-30 22:09:30 +08:00
aofrw.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
auth.tcl Adding AGPLv3 as a license option to Redis! (#13997) 2025-05-01 14:04:22 +01:00
bitfield.tcl Add BITFIELD_RO basic tests for non-repl use cases (#12187) 2023-05-18 12:16:46 +03:00
bitops.tcl Implement DIFF, DIFF1, ANDOR and ONE for BITOP (#13898) 2025-05-20 10:45:50 +03:00
client-eviction.tcl Add thread sanitizer run to daily CI (#13964) 2025-06-02 10:13:23 +03:00
dump.tcl Fix RESTORE with TTL (#14071) 2025-05-28 08:02:10 +03:00
expire.tcl handle SET KEEPTTL in the optimization path 2025-07-28 10:19:33 +03:00
functions.tcl Trigger Lua GC after script loading (#13407) 2024-07-16 09:28:47 +08:00
geo.tcl adding geo command edge cases tests (#12274) 2023-06-20 12:50:03 +03:00
hyperloglog.tcl Fix MurmurHash64A overflow in HyperLogLog with 2GB+ entries 2025-11-05 15:33:34 +02:00
info-command.tcl Make INFO command variadic (#6891) 2022-02-08 13:14:42 +02:00
info-keysizes.tcl Build with -DREDIS_TEST in PR/push CI sanitizer run (#14471) 2025-10-27 13:16:54 +02:00
info.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
introspection-2.tcl Add variable key-spec flags to SET IF* and DELEX (#14529) 2025-11-12 11:36:10 +02:00
introspection.tcl Add config base to vector-sets and hnsw thread config (#14082) 2025-06-16 10:06:43 +08:00
keyspace.tcl Add per key memory accounting (#14363) 2025-10-23 12:36:29 +03:00
latency-monitor.tcl Add printing for LATENCY related tests (#12514) 2023-08-27 11:42:55 +03:00
lazyfree.tcl Fix timing issue in lazyfree test (#13926) 2025-04-13 20:32:16 +08:00
limits.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
maxmemory.tcl New eviction policies - least recently modified (#14624) 2026-01-06 20:57:31 +08:00
memefficiency.tcl Add kvstore type and decouple kvstore from its metadata (#14543) 2025-12-08 21:12:33 +02:00
multi.tcl Fix propagation of entries_read by calling streamPropagateGroupID unconditionally (#12898) 2024-02-29 09:48:20 +02:00
networking.tcl Disable io-threads for Pending command pool expansion and shrinking test (#14449) 2025-10-23 20:42:11 +08:00
obuf-limits.tcl Reduce the main thread blocking in clients cron (#13900) 2025-06-30 09:37:17 +08:00
oom-score-adj.tcl Check user's oom_score_adj write permission for oom-score-adj test (#13111) 2024-03-05 14:42:28 +02:00
other.tcl Cluster compatibility check (#13846) 2025-03-20 10:35:53 +08:00
pause.tcl CLIENT UNBLOCK should't be able to unpause paused clients (#14164) 2025-07-24 15:20:04 +08:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl Fix some flakiness tests (#14303) 2025-08-27 11:11:59 +08:00
pubsub.tcl Fix KSN for HSETEX command when FXX/FNX is used (#14150) 2025-07-21 13:59:01 +03:00
pubsubshard.tcl Async IO Threads (#13695) 2024-12-23 14:16:40 +08:00
querybuf.tcl Adding AGPLv3 as a license option to Redis! (#13997) 2025-05-01 14:04:22 +01:00
quit.tcl flushSlavesOutputBuffers should not write to replicas scheduled to drop (#12242) 2023-06-12 14:05:34 +03:00
replybufsize.tcl Introduce debug command to disable reply buffer resizing (#10360) 2022-03-01 14:40:29 +02:00
scan.tcl SCAN: restore original filter order (#14537) 2025-11-25 15:30:43 +08:00
scripting.tcl Lua script may lead to integer overflow and potential RCE (CVE-2025-46817) 2025-10-30 13:02:49 +08:00
shutdown.tcl Tests: Do not save an RDB by default and add a SIGTERM default AOFRW test (#12064) 2023-04-18 16:14:26 +03:00
slowlog.tcl Exit early if slowlog/acllog max len set to zero (#12965) 2024-01-22 16:01:04 -08:00
sort.tcl Fix get # option in sort command (#13608) 2024-10-22 09:55:00 +08:00
tls.tcl Add TLS certificate-based automatic client authentication (#14610) 2025-12-25 14:07:58 +02:00
tracking.tcl Bump codespell from 2.2.4 to 2.2.5 (#12557) 2023-09-08 16:10:17 +03:00
violations.tcl Run large-memory tests as solo. (#10626) 2022-04-24 17:29:35 +03:00
wait.tcl CLIENT UNBLOCK should't be able to unpause paused clients (#14164) 2025-07-24 15:20:04 +08:00