1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

8 Commits

Author SHA1 Message Date
79749f2461 fix(sentinel): propagate RESP option to clients (#3011)
`createSentinel` takes RESP as an option, but does not propagate down
to the actual clients. This creates confusion for the users as they
expect the option to be set to all clients, which is reasonable.

In case of clientSideCaching, this problem manifests as validation failure
because clientSideCaching requires RESP3, but if we dont propagate,
clients start with the default RESP2

fixes #3010
2025-07-07 11:06:34 +03:00
f346bad64e Adapt legacy sentinel tests to use the new test utils (#2976)
* modified legacy sentinel tests

* Adapt legacy sentinel tests to use the new test utils

* modify tmpdir creation

* reduced sentinel config timeouts, removed unneeded comment

---------

Co-authored-by: H. Temelski <hristo.temelski@redis.com>
2025-05-27 14:21:22 +03:00
d0a5c4c945 Fix sentinel csc tests (#2966)
Co-authored-by: H. Temelski <hristo.temelski@redis.com>
2025-05-20 11:04:11 +03:00
f01f1014cb Client Side Caching (#2947)
* CSC POC ontop of Parser

* add csc file that weren't merged after patch

* address review comments

* nits to try and fix github

* last change from review

* Update client-side cache and improve documentation

* Add client side caching RESP3 validation

* Add documentation for RESP and unstableResp3 options

* Add comprehensive cache statistics

The `CacheStats` class provides detailed metrics like hit/miss counts,
load success/failure counts, total load time, and eviction counts.
It also offers derived metrics such as hit/miss rates, load failure rate,
and average load penalty. The design is inspired by Caffeine.

`BasicClientSideCache` now uses a `StatsCounter` to accumulate these
statistics, exposed via a new `stats()` method. The previous
`cacheHits()` and `cacheMisses()` methods have been removed.

A `recordStats` option (default: true) in `ClientSideCacheConfig`
allows disabling statistics collection.

---------

Co-authored-by: Shaya Potter <shaya@redislabs.com>
2025-05-19 15:11:47 +03:00
46bfeaa94e Fix typo and improve Sentinel docs (#2931) 2025-04-30 16:30:16 +03:00
10ff6debab fix(sentinel): Migrated to the new testing framework, fixed issues that were discovered during transition
* [CAE-342] Fix a couple of bugs

* Fixed issue with nodes masterauth persistency, changed docker container

* [CAE-342] Fixed a couple of sentinel issues, enabled most tests

* [CAE-342] Added comment

* [CAE-342] Migrate majority of tests to testUtils

* [CAE-342] Minor refactor

* .

* [CAE-342] Using cae containers for sentinel

* [CAE-342] Improved resiliency of the legacy tests, added TSdoc comment

* [CAE-342] Some extra logging, removed unneeded changes

* [CAE-342] Moved docker env as optional part of redisserverdockerconfig

* [CAE-342] Move password to serverArguments

* [CAE-342] Moved ts-node to devDependencies

* [CAE-342] Reverted legacy testing framework improvements
2025-04-30 15:56:29 +03:00
4708736f3b new "transform arguments" API for better key and metadata extraction (#2733)
* Parser support with all commands

* remove "dist" from all imports for consistency

* address most of my review comments

* small tweak to multi type mapping handling

* tweak multi commands / fix addScript cases

* nits

* addressed all in person review comments

* revert addCommand/addScript changes to multi-commands

addCommand needs to be there for sendCommand like ability within a multi.

If its there, it might as well be used by createCommand() et al, to avoid repeating code.

addScript is there (even though only used once), but now made private to keep the logic for bookkeeping near each other.
2024-10-31 12:16:59 -04:00
b2d35c5286 V5 bringing RESP3, Sentinel and TypeMapping to node-redis
RESP3 Support
   - Some commands responses in RESP3 aren't stable yet and therefore return an "untyped" ReplyUnion.
 
Sentinel

TypeMapping

Correctly types Multi commands

Note: some API changes to be further documented in v4-to-v5.md
2024-10-15 17:46:52 +03:00