Skip to content

redis@6.4.0

Latest

Choose a tag to compare

@nkaradzhov nkaradzhov released this 23 Nov 13:53

redis@6.4.0

✨ Highlights

This release adds an experimental multi-database client (createMultiDbClient). It keeps connections to several equivalent Redis databases, such as Active-Active replicas, and moves traffic to a healthy database when the active one fails. Command timeouts also improved: the new experimental rejectInFlight option lets timeout and abortSignal reject commands that are already sent, timeouts now apply to MULTI and pipelines, and per-command timers cost less. New commands include set member expiration, ZMOVE/BZMOVE/ZMOVEMEMBER, BITRANGEINTARRAY, BACKUP and FT.HYBRID EXPLAINSCORE. Client-side caching gains OPTIN/OPTOUT tracking modes, OpenTelemetry metrics accept custom attributes, and cluster clients get scanIterator. More than 70 bug fixes make reconnects, failover, the client-side cache, type mappings and keyPrefix more reliable. This release also welcomes 28 new contributors.

🚀 New Features

  • feat(client): add OPTIN/OPTOUT tracking modes to client-side caching (#3473) — @PavelPashov
  • feat(client): add process-level and per-client custom attributes to OTel metrics (#3573) — @PavelPashov
  • feat(client): add set member expiration commands (#3557) — @nkaradzhov
  • feat(client): add ZMOVE, BZMOVE and ZMOVEMEMBER commands (#3611) — @nkaradzhov
  • feat(client): add BITRANGEINTARRAY command (#3601) — @nkaradzhov
  • feat(client): add BACKUP commands (#3605) — @Purv-Kabaria
  • feat(client): accept a string or Buffer for VADD SETATTR, like VSETATTR (#3580) — @maxymlyskov
  • feat(cluster): add scanIterator and HSCAN/SSCAN/ZSCAN iterators (#3529) — @smit153
  • feat(search): add COMPRESSION and TRAINING_THRESHOLD to HNSW vector fields (#3488) — @PavelPashov
  • feat(search): support EXPLAINSCORE in FT.HYBRID (#3588) — @nkaradzhov

⚠️ Experimental

  • feat(client): multi-db client with automatic endpoint failover (createMultiDbClient). Works with standalone clients, pools, clusters and sentinel. The API is experimental and may change in a future release. See docs/multi-db.md. (#3435) — @nkaradzhov
  • feat(client): add commandOptions.rejectInFlight, which makes timeout and abortSignal also reject commands that were already sent and are waiting for a reply. The option is experimental, off by default, and may change in a future release. (#3636) — @nkaradzhov

🐛 Bug Fixes

Connections and reconnects

  • client: prevent late connections after shutdown (#3499) — @jakobzach
  • client: stop reconnecting after callback shutdown (#3531) — @jakobzach
  • client: reconnect after a reply the decoder cannot parse (#3608) — @yan-almeida
  • client: keep writing on drain before the socket is ready (#3591) — @nkaradzhov
  • client: retry a node connect cut short by a failover (#3628) — @nkaradzhov
  • client: stop leaking a credentials subscription on every reconnect (#3524) — @FPLandrian
  • client: invalidate WATCH when the connection is lost (#3506) — @maxymlyskov
  • client: reject MULTI and pipelines while offline when disableOfflineQueue is set (#3561) — @maxymlyskov

Reply decoding

  • client: keep decoding a chunk when a listener throws (#3486) — @maxymlyskov
  • client: restore string replies after leaving RESP2 pub/sub (#3492) — @lazerg
  • client: restore RESP2 reply decoding when a SUBSCRIBE is rejected (#3523) — @maxymlyskov
  • client: skip RESP3 attribute replies in the decoder (#3595) — @lazerg
  • client: decode integers near Number.MAX_SAFE_INTEGER exactly (#3575) — @mmporong

Database selection

  • client: keep the selected database when a pipelined command fails (#3484) — @maxymlyskov
  • client: do not record a database whose SELECT failed inside MULTI (#3489) — @maxymlyskov
  • client: select the default database in reset() (#3510) — @maxymlyskov
  • client: use the RESET fallback only while the RESET handler is installed (#3541) — @maxymlyskov

MULTI, pipelines and type mappings

  • client: apply the command timeout and abortSignal to queued MULTI and pipelines, including on pool, cluster and sentinel (#3515, #3537) — @Arthur031221
  • client: keep asap commands out of a partly written MULTI (#3496) — @jadhavgaurav
  • client: reject an oversized MULTI before any command is queued (#3507) — @rome-xi
  • client: apply the type mapping to multi().exec() replies (#3547) — @maxymlyskov
  • client: pass the type mapping to pool, cluster and sentinel batches (#3551) — @maxymlyskov
  • client: make reply parsers tolerate type mappings (#3570) — @junaidkhan80121
  • client: call a legacy callback once when it throws (#3546) — @maxymlyskov

Client-side cache

  • client: keep Buffer and VerbatimString replies intact in the client-side cache (#3544) — @OmBhandwaldar
  • client: drop evicted entries from the client-side cache key index (#3538) — @maxymlyskov
  • client: keep binary keys apart in the client-side cache (#3582) — @waw666waw666
  • client: don't cache SORT_RO, XINFO and MEMORY USAGE replies (#3616) — @samjonath
  • client: empty the client-side cache when the selected database changes (#3641) — @Cdineshreddy12
  • client: use the client-side cache in clusters with a type mapping (#3556) — @RagedPanda
  • sentinel: use the client-side cache with a type mapping (#3662) — @maxymlyskov

Cluster

  • cluster: null pubSubNode after destroying it on topology rediscovery (#3481) — @tamil-selvan-k
  • cluster: ignore superseded pub/sub connect errors during rediscovery (#3520) — @tamil-selvan-k
  • cluster: serve reads from a master demoted to replica by a failover (#3511) — @maxymlyskov
  • cluster: close a demoted master's sharded pub/sub client (#3514) — @maxymlyskov
  • cluster: follow MOVED for keyless cluster commands (#3555) — @RagedPanda
  • cluster: refresh the slot map when a pipeline gets MOVED (#3560) — @maxymlyskov
  • cluster: retry a moved sharded channel that gets MOVED (#3590) — @nkaradzhov
  • cluster: drop the source connection when the in-flight flush runs during slot migration (#3642) — @Cdineshreddy12
  • cluster: route the empty-string key by slot instead of at random (#3660) — @Cdineshreddy12

Sentinel and pool

  • sentinel: take one master lease when direct commands start concurrently (#3497) — @maxymlyskov
  • sentinel: compare mapped addresses when checking for topology changes (#3508) — @maxymlyskov
  • sentinel: reopen the sentinel connection after the sentinel restarts (#3526) — @maxymlyskov
  • sentinel: destroy connecting sentinel pub/sub clients on changeNode (#3625) — @rome-xi
  • pool: replace pool members whose reconnect strategy gave up (#3525) — @maxymlyskov
  • pool: drop pool members that destroy() closed instead of reusing them (#3572) — @maxymlyskov

Commands

Modules

🧰 Maintenance

  • perf(client): replace per-command AbortSignal timeouts with deadline lists (#3618) — @nkaradzhov
  • perf: defer cluster and sentinel transaction type expansion (#3578) — @GiHoon1123
  • chore(deps): resolve open Dependabot security alerts (#3548) — @nkaradzhov
  • chore(deps-dev): bump proxy-addr from 2.0.7 to 2.0.8 (#3503) — @dependabot[bot]
  • chore: add npm run repl with a connected client (#3566) — @nkaradzhov
  • chore: remove maintainer skills from the repo (#3509) — @nkaradzhov
  • chore(tests): bump default docker test image to 8.12, then 8.12-rc3 (#3558, #3610) — @nkaradzhov
  • test(client): create the key before BLESS SET/GET/CLEAR (#3490) — @nkaradzhov
  • test(client): wait for the server to accept in the socket retry test (#3559) — @nkaradzhov
  • test(sentinel): fix flaky scanIterator failover test (#3603) — @lazerg
  • test(sentinel): wait for an electable master before the suite starts (#3658) — @junaidkhan80121
  • test(sentinel): await the reentrant teardown instead of a fixed delay (#3651) — @Cdineshreddy12
  • docs: pass multiple values to commands as an array (#3519) — @MannXo
  • docs: explain how to share a client between modules (#3527) — @smit153
  • docs: fix two dead links (Functions intro, TS.CREATE) (#3532) — @Pharex38
  • docs: connect the pool in the pool guide and examples (#3569) — @NotAFlightRisk
  • docs(sentinel): clarify the default topology scan interval (#3600) — @Doomguy-BFG9000
  • docs(sentinel): fix dead link to client-configuration.md (#3606) — @abd1rahmane
  • docs: point the programmability links at the moved sections (#3612) — @abd1rahmane
  • docs: remove legacyMode and isolationPoolOptions from client configuration (#3613) — @ragib-mrb
  • docs: fix the type mapping and abort signal examples in command options (#3614) — @ragib-mrb
  • docs: fix wrong command names and examples in the v4 to v5 guide (#3615) — @ragib-mrb
  • docs: fix the pubsub Buffer example and channel guidance (#3630) — @ragib-mrb
  • docs: skip empty scan pages before MGET (#3632) — @ragib-mrb

New Contributors

Full Changelog: https://github.com/redis/node-redis/compare/redis@6.3.1...redis@6.4.0