redis@6.4.0-beta.0
✨ Highlights
This beta introduces the multi-database client: createMultiDbClient, createMultiDbClientPool, createMultiDbCluster and createMultiDbSentinel connect to several Redis endpoints and move traffic to a healthy one when the active endpoint fails, using health checks, a circuit breaker and configurable failover. The API is experimental and may change before the stable release. Client-side caching gains OPTIN and OPTOUT tracking modes with per-call control, and the command set grows with the BLESS family, Cuckoo CF.MEXISTS, a Count-Min Sketch cell size, HNSW vector compression and many new FT.SEARCH options.
🚀 New Features
- client: add OPTIN/OPTOUT tracking modes, a
cacheablepredicate and a per-callcacheoption to client-side caching (#3473) — @PavelPashov - client: add the BLESS command family (
BLESS SET,BLESS GET,BLESS CLEAR,BLESS SCAN), withBLESS SCANrouted across all cluster masters (#3483) — @vlady-kotsev - search: add
COMPRESSION(SQ8) andTRAINING_THRESHOLDto HNSW vector fields (#3488) — @PavelPashov - search: support
WITHSCORES,EXPLAINSCORE,WITHPAYLOADS,WITHSORTKEYS,FILTER,GEOFILTERandPAYLOADinFT.SEARCH(#3432) — @watersRand - bloom: add the Cuckoo filter
CF.MEXISTScommand (#3447) — @vlady-kotsev - bloom: add a
cellSizeparameter toCMS.INITBYDIM/CMS.INITBYPROB(#3451) — @vlady-kotsev - sentinel: emit
connect,ready,reconnectingandendlifecycle events (#3430) — @nkaradzhov - client: add
MaxCommandRedirectionsErrorwhen a cluster command exceeds its redirection limit (#3386) — @Piyush0049 - client: give clearer error messages when client options are invalid (#3441) — @AniaMakes
⚠️ Experimental
- Multi-database client with automatic endpoint failover:
createMultiDbClient,createMultiDbClientPool,createMultiDbClusterandcreateMultiDbSentinel. The API, events and configuration are marked@experimentaland may change in a future release (#3435) — @nkaradzhov - Client-side caching
strictoption: acache: truemark on a command that cannot be cached rejects instead of logging a warning. Meant for development and tests; may change (#3473) — @PavelPashov
🐛 Bug Fixes
Connection and reconnection
- Prevent a reconnect loop when the legacy
QUITis used (#3462) — @aartisonigra - Keep the reconnect retry counter sequential after the socket drops once ready (#3465) — @tamil-selvan-k
- Emit a termination event when reconnecting stops (#3433) — @GiHoon1123
- Remove the stale
datalistener on socket error (#3209) — @Chrisp1tv - Dispose of the credentials subscription on every
close()path (#3391) — @lazerg - Settle the
close()drain when the last connect fails (#3400) — @kyungseopk1m - Keep decoding a chunk when a listener throws (#3486) — @maxymlyskov
- Keep
asapcommands out of a partly writtenMULTI(#3496) — @jadhavgaurav - Keep an empty client name in
HELLO(#3468) — @xia-chao
Selected database
- Keep the selected database when a pipelined command fails (#3484) — @maxymlyskov
- Do not
- Keep batch commands routed by slot during slot migration (#3377) — @GiHoon1123
- Recreate a cluster node client after a terminal connect failure (#3403) — @nkaradzhov
- Emit
node-connect/node-readyon every reconnection (#3438) — @consegrado - Unpause destination nodes when the
SMIGRATEDhandler throws (#3445) — @tamil-selvan-k - Clear
pubSubNodeafter destroying it on topology rediscovery (#3481) — @tamil-selvan-k - Vendor
cluster-key-slotto fix the slot of keys with an empty hash tag (#3431) — @mishan
Sentinel
- Cap rediscovery retries after connect (#3388) — @DebadityaHait
- Take one master lease when direct commands start at the same time (#3497) — @maxymlyskov
Pub/Sub
- Settle an argument-less
UNSUBSCRIBEwhile pattern subscriptions remain (#3407) — @kyungseopk1m - Keep the listener for channels already subscribed when a mixed subscribe is rejected (#3467) — @tamil-selvan-k
- Update the active state after clearing maps in
removeAllListeners(#3472) — @tamil-selvan-k - Stop the subscribing counter from going below zero in resubscribe callbacks (#3476) — @tamil-selvan-k
- Restore string replies after leaving RESP2 pub/sub mode (#3492) — @lazerg
RESP and type mapping
- Decode RESP3 doubles to the exact value the server sent (#3393) — @Jaybhade
- Keep
String.prototypein fast mode after definingVerbatimString(#3479) — @Ceereals - Honour
typeMappinginXINFO STREAMand vector set replies (#3470) — @xia-chao - time-series: honour
typeMappingfor labels in RESP2 replies (#3412) — @abhijeet117
Command arguments
- Send an empty message in
PING('')instead of a barePING(#3464) — @xia-chao - Preserve empty
MATCHpatterns in scan commands (#3460) — @jakezwang - Stop scan iterators when the cursor is a
Buffer(#3428) — @UgaTheDev - Forward
XRANGE ... COUNT 0and handle its null reply (#3449) — @xia-chao - Keep the empty consumer filter argument in
XPENDING(#3494) — @wToTw123 - Keep pending stream entries whose message was deleted in
XREADGROUPreplies (#3500) — @maxymlyskov - Require an
XADDTRIMstrategy, as the command grammar does, and always send it (#3418) — @abhijeet117 - Require the approximate (
~) modifier forXTRIMLIMIT(#3425) — @abhijeet117 - Accept sampled events in the
LATENCYcommand argument types (#3421) — @abhijeet117
Reply types
- Handle the
ACL GETUSERnull reply for users that do not exist (#3413) — @abhijeet117 - Type
ACL GETUSERflags as a RESP3 set (#3417) — @abhijeet117 - Type
COMMAND DOCSset containers as RESP3 sets (#3424) — @abhijeet117 - Expose the
watch,rbsandrbpfields inCLIENT INFOandCLIENT LISTreplies (#3415) — @abhijeet117 - Expose the
MEMORY STATSfields added in Redis 7.4 (#3416) — @abhijeet117 - Correct the
HELLOmodules reply type (#3411) — @abhijeet117 - Include all replica states in the
ROLEreply type (#3420) — @abhijeet117 - Correct the
CLUSTER BUMPEPOCHreply type (#3414) — @abhijeet117 - Include
NOKEYin theMIGRATEreply type (#3419) — @abhijeet117 - Correct the
XINFO GROUPSlast-delivered-idreply type (#3410) — @abhijeet117 - Name a
🧰 Maintenance
- ci: use npm trusted publishing for releases (#3480) — @nkaradzhov
- build: replace the deprecated
npm -wsshorthand (#3477) — @nkaradzhov - test-utils: boot cluster test containers on newer Redis builds (#3471) — @nkaradzhov
- test: create the key before
BLESS SET/GET/CLEAR(#3490) — @nkaradzhov - docs: clarify config tables, fix typos and align JSDoc examples (#3452, #3456, #3458) — @codeXsidd
- docs: note that
sendCommanddoes not applykeyPrefix(#3455) — @xia-chao - docs: fix test instructions and refresh
CONTRIBUTING.md(#3443) — @nkaradzhov - examples: add a fixed-window rate limiter using
INCRandEXPIRE(#3453) — @codeXsidd - chore: remove the
CLAUDE.mdsymlink in favour ofAGENTS.md(#3459) — @jarrensj - chore(skills): add a maintainer-triage skill and a step to regenerate static command metadata (#3429, #3446) — @nkaradzhov, @vlady-kotsev
- deps: bump
ip-address,socks,brace-expansion,js-yaml,nanoidandmocha(#3389, #3436, #3440, #3482, #3485) — @dependabot
New Contributors
- @Chrisp1tv made their first contribution in #3209
- @DebadityaHait made their first contribution in #3388
- @lazerg made their first contribution in #3391
- @Jaybhade made their first contribution in #3393
- @konovalovsergey made their first contribution in #3395
- @kyungseopk1m made their first contribution in #3400
- @UgaTheDev made their first contribution in #3428
- @mishan made their first contribution in #3431
- @consegrado made their first contribution in #3438
- @AniaMakes made their first contribution in #3441
- @tamil-selvan-k made their first contribution in #3445
- @vlady-kotsev made their first contribution in #3446
- @xia-chao made their first contribution in #3449
- @codeXsidd made their first contribution in #3452
- @jarrensj made their first contribution in #3459
- @jakezwang made their first contribution in #3460
- @Ceereals made their first contribution in #3479
- @maxymlyskov made their first contribution in #3484
- @wToTw123 made their first contribution in #3494
- @jadhavgaurav made their first contribution in #3496
Full Changelog: https://github.com/redis/node-redis/compare/redis@6.2.0...redis@6.4.0-beta.0