Redis 8.12
What's new in Redis 8.12
Release notes:
8.12-rc1 | 8.12-rc2 | 8.12-rc3 | 8.12.0
Redis 8.12 introduces new features and performance improvements, building on the foundation of Redis 8.10.
This release delivers improvements across multiple areas:
- Compressed bitmaps: Roaring bitmap integration that reduces memory usage and speeds up bitmap operations, plus the
BITRANGEINTARRAYcommand SEXPIRE,SPEXPIRE,SEXPIREAT,SPEXPIREAT,STTL,SPTTL,SEXPIRETIME,SPEXPIRETIME: set and get expiration on individual set membersZMOVE,BZMOVE,ZMOVEMEMBER: atomically move members between sorted setsBLESS: protect specified keys from evictionCLUSTER MIGRATION STATUS: progress reporting for the snapshot and incremental migration phasesSLOWLOG GET: reports the CPU time of each slow commandtls-groups: configure Transport Layer Security (TLS) named groups- Count-min sketch: optional
CELL_SIZEfor lower memory usage, and negative increments inCMS.INCRBY - Automatic creation of deep paths in JSON
- 8-bit scalar quantization (SQ8) compression for hierarchical navigable small world (HNSW) vector fields
COLLECT LIMIThonorssearch-max-aggregate-results- Performance and resource utilization improvements across core, Search, JSON, and Probabilistic
- Numerous bug fixes across core, Search, JSON, and Probabilistic
- Behavior changes in Search and Probabilistic
- New Modules API flag and function, and JSON shared API functions
Below is a detailed breakdown of these updates.
Supported operating systems
Redis 8.12 is tested on:
- Ubuntu 22.04 (Jammy Jellyfish), 24.04 (Noble Numbat), 26.04 (Resolute Raccoon)
- Rocky Linux 8.10, 9.7, 10.1
- AlmaLinux 8.10, 9.7, 10.1
- Debian 12.13 (Bookworm), Debian 13.4 (Trixie)
- Alpine 3.23
- macOS 14.8.4 (Sonoma), 15.7.4 (Sequoia), 26.3 (Tahoe) - for both Intel and ARM
Security fixes
- A TLS session could be resumed on another listener (client port or cluster bus), or after
tls-auth-clientsortls-expected-peer-namechanged, without the checks of the new settings (#16127). - Indexed value hashing in Search is collision-resistant, preventing index degradation from hash-based denial-of-service (HashDoS) attacks (#Q10073, MOD-14459).
unicode_tolowerno longer reads out of bounds on a dangling multi-byte lead byte in indexed TEXT fields encoded with the 8-bit Unicode Transformation Format (UTF-8) (#Q11202, MOD-18088).
New features
Compressed bitmaps
Redis 8.12 integrates redis-roaring (#15331), which reduces memory usage and speeds up bitmap operations. Thanks to Antonio, its creator, for contributing this capability. Roaring bitmap creation is disabled by default; see Roaring-compressed bitmaps to enable it with the bitmap-default-roaring configuration parameter.
The new BITRANGEINTARRAY command (#15986) returns the offsets of set bits within a range. It's equivalent to redis-roaring's R.RANGEINTARRAY.
Set member expiration
You can now set an expiration on individual set members (#15938). See Member expiration.
- The new
SEXPIRE,SPEXPIRE,SEXPIREAT, andSPEXPIREATcommands set the expiration. - The new
STTL,SPTTL,SEXPIRETIME, andSPEXPIRETIMEcommands return the remaining time to live (TTL) or the expiration timestamp.
Sorted set moves
The new ZMOVE, BZMOVE, and ZMOVEMEMBER commands (#16135) atomically move members between sorted sets: from either end, by score range, or by name. They support COUNT batching and NX/XX destination conditions.
Eviction protection
The new BLESS command (#15828) protects specified keys from eviction. Use BLESS SET and BLESS CLEAR to add and remove protection, BLESS GET to check a key's status, and BLESS SCAN to list protected keys. See Protecting keys from eviction.
Cluster migration progress
CLUSTER MIGRATION STATUS reports progress for both the snapshot and incremental migration phases (#15829).
SLOWLOG GET CPU time
SLOWLOG GET reports the CPU time of each slow command in a new eighth field (#15907). Use it to tell commands that ran slowly apart from commands that were starved of CPU. The new off-cpu-tracking configuration parameter controls this tracking.
TLS named groups
The new tls-groups configuration directive (#15556) configures the TLS named groups. See TLS.
Count-min sketch cell size
Count-min sketches support an optional CELL_SIZE argument in CMS.INITBYDIM and CMS.INITBYPROB for lower memory usage (#P1063). CMS.INCRBY accepts negative increments to decrement counts, and CMS.INFO reports cell sizes.
JSON deep path auto-creation
JSON can automatically create deep paths (#J1640). When the json-auto-create-deep-paths configuration parameter is enabled, JSON.SET creates missing parent objects.
SQ8 vector compression
8-bit scalar quantization (SQ8) compression is available for HNSW vector fields (#Q11330, MOD-14958). See HNSW vector compression.
COLLECT LIMIT
COLLECT LIMIT in FT.AGGREGATE honors the configurable search-max-aggregate-results (#Q10063).
Bug fixes
Redis 8.12 includes a broad set of bug fixes (compared to 8.10.0).
Core fixes
- Changes made by
XDELEX DELREFfor already-deleted stream entries could fail to propagate to replicas or the append-only file (AOF) (#15569). - Operations using random radix-tree traversal could behave incorrectly when starting from certain leaf nodes (#15508).
- Memory usage could be calculated incorrectly for hashes using shared templates (#15604).
- Redis database (RDB) files could fail to load after
XSETIDreduced a stream'sentries_addedcounter (#15489). SETcould calculate an incorrect expiration time when given an excessively large relative TTL (#15626).- Active defragmentation could incorrectly handle the shared-template registry used by compact hashes (#15628).
- After failover, a replica could remain connected to another replica instead of the new primary (#15530).
- Invalid cluster slot ranges could be accepted after being merged into a valid range (#15733).
RESTOREcould calculate an incorrect expiration time when given an excessively large relative TTL (#15756).- Memory growth could be accounted for incorrectly when
SETBITorBITFIELDexpanded a string (#15699). XTRIMcould leave a stream in a state that prevented an RDB file containing it from loading (#15815).- Clients could fail to receive a protocol error when a malformed command arrived across multiple network reads (#15795).
ARLASTITEMScould omit elements appearing after a gap in an array (#15875).- Data could be lost when a legacy AOF file was upgraded before loading completed (#15916).
- Hiredis clients on Linux could mishandle errors when establishing Transmission Control Protocol (TCP) connections (#15917).
- Redis could crash when a module thread paused input/output (I/O) threads (#15869).
- Publish/subscribe (Pub/Sub) subscriptions could remain active after the subscribing user's channel permissions were revoked or the user was deleted, if the client had re-authenticated as another user (#15468).
- Module actions scheduled by hash-field expiration notifications could be delayed after fields expired in the background (#15623).
- Data could be lost after a replica migrated to a different shard (#15680).
LMOVEMcould emit keyspace notifications inconsistent with those produced byLMOVE(#15587).- Command side effects could be propagated to replicas or the AOF despite settings that should have excluded them (#15695).
- A replica that fell behind by more than its output buffer soft limit was disconnected even when
repl-backlog-sizewas larger (#16098). - Keys could be lost during atomic slot migration when the destination rejected a command, for example with
-NOREPLICASdue tomin-replicas-to-write(#16176). - Set members could be expired incorrectly on the destination during atomic slot migration (#16210).
MSETEXwith repeatedEXorPXoptions was propagated to replicas and the AOF as an invalid command, losing the keys (#16096).- Commands could be replayed twice on AOF load when an AOF rewrite started after an AOF write error, such as a full disk (#16175).
XADDentries withIDMPcould be lost on AOF replay or on a lagging replica, andXIDMPRECORDcould crash a lagging replica (#15955).- Consumers created by
XCLAIMorXAUTOCLAIMthat claimed no entries were not propagated to replicas or the AOF (#15930). - Some key updates could apply the value or TTL to a different key while the keyspace was being resized (#16121).
- Redis could crash with
io-threads> 1 when running module commands that usegetkeys-apiorgetchannels-api(#16042). - Redis could crash when a module read a sorted set emptied by
ZPOPMIN/ZPOPMAXfrom its keyspace notification (#16165). ZRANGESTOREwith the same source and destination key could cause a use-after-free whenkey-memory-histogramsorcluster-slot-stats-enabledis enabled (#16125).ZRANGESTOREcould create a sorted set with a broken score order when the source was a listpack loaded from an unordered payload (#16167).- A sorted set restored without
sanitize-dump-payloadcould store a duplicate member twice after its conversion to the B+tree encoding (#16164). - A malformed
RESTOREpayload or RDB file could corrupt memory, only with modules that register key metadata classes (#16146). CONFIG GETandCONFIG REWRITEdropped then,o, andcflags ofnotify-keyspace-eventswhenAwas set, so these events stopped after a restart (#16142).DELEXhonoredlazyfree-lazy-server-delinstead oflazyfree-lazy-user-del(#16120).- Lua scripts with very deep string patterns could exhaust the stack; such patterns now fail with
pattern too complex(#16203). - Redis could crash when using
preload-filewith AOF and a working directory of 1024 bytes or longer (#16233). - On FreeBSD, the bundled jemalloc took over libc's malloc hooks, which could crash multi-threaded tools such as
redis-benchmark --threadsand deadlock afterfork()(#16062).
Redis Search fixes
- The shard no longer crashes with a segmentation fault (
SIGSEGV) whenRESTOREof a legacyft_index0payload is issued outside an RDB load (#Q10872, MOD-15685). - Arming the garbage collection (GC) timer off the main thread on ARM no longer causes random shard crashes after extended uptime (#Q10728, MOD-17309).
- The server no longer crashes on writes when an index
FILTERreferences no schema fields (#Q10767, MOD-15592). FT.ALTER SCHEMA ADDrunning concurrently with queries underWORKERS>0no longer crashes query execution across VECTOR, TAG, NUMERIC, GEO, ISMISSING, and GEOSHAPE nodes (#Q11303, #Q11304, #Q11308, #Q11309, #Q11310, #Q11311; MOD-18356, MOD-18361, MOD-18366, MOD-18367, MOD-18368).FT.AGGREGATEwith the numericSORTBYoptimizer no longer crashes or returns wrong results (#Q11474, MOD-6967).- The coordinator no longer crashes with Redis serialization protocol version 2 (RESP2) when
FT.PROFILE HYBRIDhits a return-strict timeout (#Q10209, MOD-16396). - TEXT
PHONETICmatches now behave correctly when non-TEXT fields precede TEXT fields in the schema (#Q10145, MOD-16304). - An
FT.AGGREGATEcursor withFILTERreports the correct result count (#Q11262, MOD-18172). FT.EXPLAINnow renders a multi-word tag value as a single tag rather than anINTERSECT(#Q11282, MOD-8666).- NOT queries no longer leak excluded documents or drop results after a concurrent index change (#Q10768, MOD-17394).
- Numeric index cardinality and bounds are now correct under float compression (#Q10637, MOD-16877).
- Empty wildcard patterns no longer cause out-of-bounds writes or spurious empty-value matches (#Q10704, MOD-17451).
- Wildcard
?onWITHSUFFIXTRIETEXT fields now matches per codepoint rather than per byte (#Q10752, MOD-17476). - Suffix-trie wildcard queries on TEXT fields are now case-insensitive (#Q10112, MOD-16259).
Wildcard_MatchRuneno longer hangs on a literal*in the indexed string (#Q11450).- Duplicate vector results are no longer returned during tiered indexing (#Q11267, MOD-17795).
FT.SEARCHon a cluster returns an error for invalidLIMITarguments, matching standalone behavior (#Q10731, MOD-12465).FT.SEARCHunderWORKERS>0no longer returns a nil field-array for documents re-indexed mid-query (#Q10251, MOD-16507).- Sort keys with embedded NUL bytes are no longer truncated in replies (#Q10921).
- The
RETURN_STRICTsafe-loader no longer deadlocks the Redis global lock (GIL) on client timeout (#Q10085, MOD-16267). - An index reference leak after queued search cancellation no longer occurs (#Q11449, MOD-18682).
- Memory leaks after coordinator SEARCH cancellation no longer occur (#Q11369, MOD-18548).
- SST replication no longer hangs and the numeric snapshot is no longer corrupted when disk GC is mid-cycle (#Q10881, MOD-17197).
FT.HYBRIDcursor setup now has a bounded channel timeout (#Q10110, MOD-16145).RETURN_STRICTcursors are depleted on timeout; strict-timed-out hybrid cursor cycles drop their cursors at cycle end (#Q10211, #Q10745; MOD-16091, MOD-16991).- Coordinator cursor memory is now capped via
INDEX_CURSOR_LIMIT(#Q10947, MOD-17479). - Cursor reads no longer time out against an earlier read's deadline and correctly report a timeout that expires while iterators are revalidated (#Q10766, #Q10763; MOD-17489, MOD-17488).
- RDB and replication payloads no longer leak a stray heap byte (#Q10993, MOD-17800).
FT.HYBRIDreturns a stable reciprocal rank fusion (RRF) result order across cluster shards (#Q10074, MOD-12438).- Cluster TLS connections now use Redis node metadata, aligning with topology changes (#Q11027, MOD-15869).
- Cluster topology is now refreshed on topology-change events rather than by polling (#Q10380, #Q10430; MOD-15868, MOD-15870).
- Coordinator fanout now preserves binary argument lengths (#Q10835).
- Replica stalls during
FT.DROPINDEX DDare reduced (#Q11095). - Internal query arguments missing during a rolling upgrade are tolerated (#Q10083, MOD-16047).
- Forced GC now waits for a concurrent child process instead of skipping its cycle (#Q10816).
- The asynchronous disk read pool no longer spins when saturated; it blocks instead (#Q10958).
- The VectorSimilarity dependency addresses unaligned metadata access on ARM/Scalable Vector Extension (SVE) paths (#Q10646, MOD-15303).
FT.PROFILE ON_TIMEOUT FAILnow reports a pre-execution timeout as a warning rather than an error (#Q10352, MOD-16660).- Crash reports now include in-flight coordinator aggregate, hybrid, and cursor-read queries (#Q10870, MOD-16992).
- Debug aggregate request synchronization no longer crashes (#Q11089, MOD-17616).
JSON fixes
- Array-index normalization overflow for extreme negative indexes, including
i64::MIN, affecting commands such asJSON.ARRTRIM(#J1636). JSON.MGETkey-spec metadata now identifies all key arguments and excludes the trailing JSONPath argument (#J1648).- Downstream compilation when using
redis_json_module_create!with theas-libraryfeature and the new RDB depth configuration (#J1670).
Probabilistic fixes
TDIGEST.QUANTILE,TDIGEST.CDF, andTDIGEST.TRIMMED_MEANcould return a not-a-number (NaN) value for a sketch with exactly one observation (#P1035).- RDB loading and
RESTOREinconsistently rejected invalid numeric values, allocation sizes, serialized counts, or inconsistent metadata in Bloom filters, count-min sketches, Top-K sketches, and t-digests. Bloom filter growth lacked overflow checks (#P1053). - Bloom filters with excessive hash-function counts could be accepted during loading and restoration, including through
BF.LOADCHUNK(#P1067). - Top-K sketches containing nonempty items with zero counts or empty-string items with nonzero counts could be restored incorrectly (#P1053).
CMS.MERGEkey metadata did not correctly identify the destination and all source keys, affecting cluster slot validation (#P1062).CF.COMPACTcommand metadata was missing its argument count and key specification (#P1071).
Performance and resource utilization improvements
Redis 8.12 delivers a broad set of performance improvements (compared to 8.10.0).
Core improvements
- Batch updates to hashes using shared templates run more efficiently (#15618).
- Supported x86 systems use the processor-based monotonic clock by default, with runtime calibration to reduce timing overhead (#15018).
- RDB and AOF loading provides sequential-read hints to the operating system to improve loading efficiency (#15782).
SORTandSORT_ROno longer convert listpack-encoded sorted sets to B+tree, which increased their memory usage, including on read-only replicas (#15622).ZADDthat converts a sorted set to B+tree no longer leaves an oversized member index, which wasted memory and slowedZSCAN(#16163).- Client memory (
tot-mem,mem_clients_normal,maxmemory-clients) now includes the names of watched keys and of Pub/Sub channels and patterns (#16069). - Faster
ZRANGESTOREfor largeREVrank ranges (#16126). - Faster
ZRANDMEMBERwith a large positive count on B+tree sorted sets (#16156). - Faster
SRANDMEMBERwith a positive count on hashtable-encoded sets (#15420). - Faster
HEXPIREandHSETEXupdates of field expiration on listpack-encoded hashes (#15901).
Redis Search improvements
- Searches on indexes using field-level expiration (
HEXPIRE) are faster (#Q10169, MOD-16350). - Coordinator field lookup and row-reply serialization overhead is reduced (#Q10981, #Q11065; MOD-17924).
- Cluster reply conversion, result destruction, and
GROUPBYcleanup have reduced overhead (#Q11055, #Q11056, #Q11057; MOD-17908, MOD-17909, MOD-17910). - Query replies now format integral numeric values without
snprintfand declare reply collection lengths up front (#Q11507, #Q11506; MOD-18800, MOD-18799). - Hash field loading for
RETURNandLOADno longer requires per-field allocations (#Q11509, MOD-18811). FT.ALTERavoids unnecessary document reindexing during schema additions (#Q11278, MOD-18171).- Score/payload-only hash updates avoid reindexing (#Q11384, MOD-18182).
- Hash documents are no longer re-indexed when no indexed field is touched (#Q11230, MOD-17688).
- Coordinator requests are now allocated on the main thread, removing
CoordRequestCtx(#Q10515, MOD-16990). - Query usage is now separated from administrative index operations (#Q11018, MOD-17536).
JSON improvements
- Memory usage reporting divides a shared string's allocation, including header and padding, proportionally among its references. Previously, each reference was charged the full allocation (#J1645).
- JSON parsing uses compact object allocation to reduce memory usage (#J1660).
- JSONPath parsing and evaluation reduce backtracking, temporary allocations, and repeated traversal. Optimizations cache root-path operands across filter candidates, stop existence checks at the first match, and reduce regex matching and string comparison overhead (#J1661).
- Typed-array element access uses direct indexing, avoiding repeated iteration and quadratic work during full indexed scans (#J1631).
Probabilistic improvements
- t-digest compression performs better for inputs containing many duplicate values. Sorting is bounded to O(n log n), avoiding quadratic behavior on pathological inputs (#P1049).
Behavior changes
Redis Search
FT.CREATErejectsRERANKon HNSW vector fields in random access memory (RAM) mode (#Q10109, MOD-16015).- Disk indexes reject
DIALECT 4andWITHOUTCOUNT(#Q10200, MOD-15997). COLLECTrequires an@prefix for field names (#Q10082, MOD-16233).- JSON
HIGHLIGHT/SUMMARIZEfields with multi-value JSONPath are now rejected (#Q11106, MOD-16530). - Non-cacheable commands are now marked with
dont_cache(#Q10208, MOD-16175). - Numeric command arguments are now strictly parsed (#Q10699, MOD-17409).
- The Search module requires Redis 8.9.241 or newer to load (#Q11335, MOD-15868).
Probabilistic
- Rejected
CMS.INCRBYitem updates now leave counters and the total count unchanged instead of saturating counters on overflow. Multi-item commands can still partially succeed (#P1063). CMS.MERGEnow requires matching cell sizes across the destination and all sources (#P1063).
Modules API
REDISMODULE_NODE_PORT_TLS: a newRM_GetClusterNodeInfo()flag to retrieve a cluster node's TLS port (#15517).RedisModule_GetUsedMemoryRatioEstimate: likeRedisModule_GetUsedMemoryRatio, but can be called from module threads without holding the GIL (#16105).getWithPathin JSON shared API V9: evaluates a precompiled JSONPath, so callers can compile a path once and reuse it across documents (#J1623).pathParseNoErrorMsgin JSON shared API V10: compiles JSONPaths without a Redis context or an allocated error message. Returns a compiled handle on success orNULLon failure (#J1666).- JSON pre-command hooks are optional, and hook errors can abort JSON commands before execution. Hooks now return
RedisResult<()>; shared C API calls continue to ignore hook errors (#J1653). - The Rust
Managerinterface addsclone_valueandcreate_objectto support construction of missing paths. Custom implementations must implement these methods and satisfy the newBorrow<Self::V>requirement for owned values (#J1640).
Configuration parameters
bitmap-default-roaring: enables the new Roaring bitmaps type; disabled by default (#15331).stream-stats: enables the per-database stream histograms inINFO STREAMS; disabled by default (#15682).off-cpu-tracking: controls the CPU time tracking reported bySLOWLOG GET(#15907).json-legacy-rdb-depth-limit: enforces a maximum nesting depth of 128 when loading JSON from RDB or throughRESTORE; disabled by default (#J1657).json-auto-create-deep-paths: disabled by default and configurable only at load time. Use the same value across shard nodes and AOF replays to prevent data divergence (#J1640).
Metrics
INFO keysizeshistograms include stream key sizes (#15374).INFO STREAMSprovides per-database histograms of consumer groups per stream, pending entries per group, and consumers per group. Enable withstream-stats yes(#15682).FT.INFOexposes the defaultEF_RUNTIME(#Q10097, MOD-16147).- Disk GC
bytes_collectedand cycle statistics are reported inFT.INFO(#Q10107, MOD-14621). FT.INFOon the coordinator aggregates per-field disk metrics via the reducer (#Q10464, MOD-14859).- Redis
INFObreaks down query timeout metrics by pipeline stage (#Q10204, MOD-13192). - Index metrics are no longer collected for unrelated
INFOsections (#Q11521, MOD-18033). FT.PROFILEloader-field timing resolution is improved (#Q10536, MOD-17132).
CLI tools
redis-clicould generate excessive help entries from aCOMMANDreply with extreme arity values (#16117).redis-cli --keystatsprinted empty statistics when no keys were found (#15823).