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

634 Commits

Author SHA1 Message Date
Shaya Potter
2eaaa58736 add addscores to aggregate search command (v5) (#2818) 2024-10-11 11:24:27 +03:00
Shaya Potter
f7d824c07c CAE-193: add "IGNORE" options to time series commands (for v5 branch) (#2753)
* CAE-193: add "IGNORE" options to time series commands (for v5 branch)

* add INCR/DECR and modify tests to not test ignore on older version

* require maxTimeDiff/maxValDiff to be specified

also rename them

* fix add/ignore test after api change

* update tests for api change in IGNORE option
2024-10-11 11:22:31 +03:00
Leibale Eidelman
949b944b0f fix FIRST_KEY_INDEX for FT.SUG* commands 2024-07-01 16:09:07 -04:00
gianDiazM
4452117946 clientKillMaxAge typo, replace MANAGE by MAXAGE (#2782)
Co-authored-by: “gianDiazM” <“gian.diaz.marquez@gmail.com”>
2024-07-01 09:08:22 -04:00
Shaya Potter
85d5bf4125 add CLIENT KILL MAXAGE (v5) (#2760)
* add CLIENT KILL MANAGE maxAge (v5)

* replace "MANAGE" with "MAXAGE"

* fix test

---------

Co-authored-by: Leibale Eidelman <me@leibale.com>
2024-06-18 10:01:41 -04:00
Shaya Potter
271baf3a65 HSCAN NOVALUES support (v5) (#2758)
* HSCAN VALUES support (v5)

* add hscanNoValuesIterator

* nitpick

---------

Co-authored-by: Leibale Eidelman <me@leibale.com>
2024-06-03 10:16:07 -04:00
John Olmsted
31c881e90e Default reconnect strategy uses exponential backoff and jitter (#2736)
* Default reconnect strategy uses exponential backoff and jitter

Both are recommended parts of client reconnect strategies to prevent
thundering herd problems when many clients lose their connection at once
(for example, during a Redis upgrade).

* Move default retry strategy to constant

* Plain english explanation of default 'socket.reconnectStrategy'

* Extract default connect strategy into helper function
2024-05-28 10:16:52 -04:00
Leibale
f9252356ae docs 2024-02-28 14:33:26 -05:00
Leibale
88ef3b87ed exclude ./lib/sentinel/test-util.ts from build 2024-02-28 10:26:23 -05:00
Shaya Potter
3e167912fb More fixes for socket issue (#2710)
* more typing fixes

* try to redo typing a bit and genericize to make better

* use genericized cluster options for cluster as well
2024-02-21 10:29:24 +02:00
Leibale
2309d09ca1 fix socket type issues 2024-02-15 09:57:25 -05:00
Leibale
cc85112e54 remove console.log 2024-02-12 18:38:18 -05:00
Leibale
65eb69a787 fix legacy client command functions - do not return "empty" promise 2024-02-12 18:38:09 -05:00
Leibale
77ecdf2721 fix #2679 - fix socket types, and clean some code 2024-02-12 18:38:00 -05:00
Leibale
8340a9e830 some cleanups 2024-02-05 11:18:27 -05:00
Shaya Potter
8f3a276509 Sentinel Support (#2664)
* redis client socket changes needed for sentinel

* Sentinel Implementation [EXPERIMENTAL]

* add pooling

* improve typing with SENTINEL_ client members

* cleanup - remove unused comments / commented code

* small sendCommand change + revert change to tsconfig

* add more sentinel commands needed for testing.

* lots of fixups and a reasonable first pass test suite

* add a timer option to update topology in background

+ don't need both sentinel client and pubsubclient
+ nits

* format all the things

* more progress

* small cleanup

* try to group promises together to minimize the internal await points

* redo events, to keep a single topology event to listen on

* nits + readme

* add RedisSentinelFactory to provide lower level access to sentinel

* nit

* update

* add RedisSentinelClient/Type for leased clients
	returned by aquire()
	used by function passed to use()

* add self for private access + improve emitting

* nit

* nits

* improve testing

- improve steady state waiting between tests
- get masternode from client, not from sentinels themselves (not consistent and then client isn't changing as we expect
- provide extensive logging/tracing on test errors
	- provide a very low impact tracing mechanism withinthe code that only really impacts code when tracing is in use.

* ismall nit for typing

* bunch of changes

- harden testing
	- don't use sentinel[0] for debug error dump as could be downed by a test
	- increase time for sentinel down test to 30s (caused a long taking failover)
- add client-error even / don't pass throuh client errors as errors option for pubsub proxy
- when passing through cient errors as error events, dont pass the event, but the Error object, as only Error objects are supposed to be on 'error'
	-

* improve pub sub proxy.

save the refference to all channel/pattern listeners up front on creation, dont hve to fetch the object each time, as it doesn't change.

removes race condition between setting up the listener and the pub sub node going down and being recreated.

* wrap the passed through RedisClient error to make clear where its coming from.

* refactor sentinel object / factory tests apart

* harden tests a little bit more

* add pipeline test

* add scripts/function tests + fixups / cleanups to get them to work

* change to use redis-stack-server for redis nodes to enable module testing

* fix test, forgot to return in use function with module

* rename test

* improve tests to test with redis/sentinel nodes with and withput passwords

this tests that we are handling the nodeClientOptions and sentinelClientOptions correctly

* cleanup for RedisSentinel type generic typing in tests

* remove debugLog, just rely on traace mechanism

* added multi tests for script/function/modules

* don't emit errors on lease object, only on main object

* improve testing

* extract out common code to reduce duplication

* nit

* nits

* nit

* remove SENTINEL_... commands from main client, load them via module interface

* missed adding RedisSentinelModule to correct places in RedisSentinelFactory

* nits

* fix test logging on error

1) it takes a lot of time now, so needs larger timeout
2) docker logs can be large, so need to increase maxBuffer size so doesn't error (and break test clean up)

* invalidate watches when client reconnects

+ provide API for other wrapper clients to also create invalid watch states programatically.

Reasoning: if a user does a WATCH and then the client reconnects, the watch is no longer active, but if a user does a MULTI/EXEC after that, they wont know, and since the WATCH is no longer active, the request has no protection.

The API is needed for when a wrapper client (say sentinel, cluster) might close the underlying client and reopen a new one transparently to the user.  Just like in the reconnection case, this should result in an error, but its up to the wrapping client to provide the appropriate error

* remove WATCH and UNWATCH command files, fix WATCH and UNWATCH return type, some more cleanups

* missing file in last commit :P

* support for custom message in `WatchError`

* setDirtyWatch

* update watch docs

* fixes needed

* wip

* get functions/modules to work again

self -> _self change

* reuse leased client on pipelined commands.

though I realize this implementation, really only works after the first write command.

unsure this is worth it.

* test tweaks

* nit

* change how "sentinel" object client works, allow it to be reserved

no more semaphore type counting

* review

* fixes to get more tests to pass

* handle dirtyWatch and watchEpoch in reset and resetIfDirty

* "fix", but not correct, needs more work

* fix pubsub proxy

* remove timeout from steadyState function in test, caused problems

* improve restarting nodes

* fix pubsub proxy and test

---------

Co-authored-by: Leibale Eidelman <me@leibale.com>
2024-02-05 09:48:33 -05:00
Leibale
0cd6915698 fix client.reset 2024-01-31 15:07:01 -05:00
Leibale
baef3486ad fix client.reset 2024-01-31 13:23:26 -05:00
Leibale
1006e3b29f fix dirty selected DB check 2024-01-29 08:29:55 -05:00
Leibale
f7f51b9c92 fix pubsub handler 2024-01-29 08:02:54 -05:00
Leibale
dded3de090 fix monitor, add client.reset & client.resetState, some fixes 2024-01-24 12:28:30 -05:00
Leibale
c2747dea1c Merge branch 'v5' of github.com:leibale/node-redis into v5 2024-01-24 03:31:17 -05:00
Leibale
455939c775 fix pubsub listener type 2024-01-17 18:33:46 -05:00
Leibale
97463e9dcc chain pipeline commands 2024-01-17 15:30:01 -05:00
Leibale Eidelman
0f188a4eec make cluster.connect() return this 2024-01-16 15:16:51 -05:00
Leibale
c1fc0feed0 #2670 #2668 - add note about command modifiers that changes the reply type 2024-01-03 11:46:09 -05:00
Leibale
6686f44d3b move from TypeScript privates to "#" 2023-12-18 17:03:21 -05:00
Leibale
d1f50df192 improve decoder tests coverage, use actual private ("#") instead of TypeScript private 2023-12-18 16:00:19 -05:00
Leibale
f3631f8e73 improve decoder coverage + fix some bugs 2023-12-13 12:27:29 -05:00
Leibale
c56f628cf8 remove .only 2023-12-12 17:02:21 -05:00
Leibale
9a9c9a6379 Merge branch 'master' of github.com:redis/node-redis into v5 2023-12-12 16:27:11 -05:00
Leibale
94cb86f605 test RESP decoder + fix some bugs 2023-12-12 16:15:50 -05:00
Leibale
7f7a53a1b1 uncomment some tests, fix bugs with _selectedDB 2023-12-07 09:42:04 -05:00
Leibale
3b28aa6c81 add errors iterator to MultiErrorReply 2023-12-07 09:01:43 -05:00
Leibale
98cbdd0a7b upgrade deps 2023-12-05 12:55:15 -05:00
Leibale
cb779a3ed7 #2666 for v5 2023-12-05 12:51:56 -05:00
Leibale
b99502b874 fix client pubsub and uncomment tests 2023-12-05 12:05:12 -05:00
Leibale
0b3d5fa9e0 remove .only from pool tests 2023-12-05 11:44:16 -05:00
Leibale
f804b0949d use asap fro pubsub resubscribe 2023-12-05 11:44:00 -05:00
Leibale
d8cb5de8b1 fix #2563 - add support for MONITOR 2023-12-05 10:02:07 -05:00
Leibale
a227cb0cef Release search@1.1.6 2023-11-20 13:49:13 -05:00
Leibale
0419b600b8 Release graph@1.1.1 2023-11-20 13:48:43 -05:00
Leibale
debd277002 Release client@1.5.12 2023-11-20 13:48:13 -05:00
Guy Korland
9ed9cb5be9 export missing graph types 2023-11-20 13:42:35 -05:00
Savvas Papageorgiadis
0ee3278085 chore(search): export languages (#2651) 2023-11-20 13:41:44 -05:00
Clubsandwich
623b56b5ca fix cluster.sUnsubscribe - make listener optional 2023-11-20 13:40:38 -05:00
Mustafa Ateş Uzun
e91509a3e1 fix GRAPH.EXPLAIN - fix transform typo in transformReply 2023-11-20 13:40:06 -05:00
Leibale Eidelman
68d835d7a2 fix #2632 - handle socket close in "socket initiator" phase (#2653) 2023-11-20 13:16:36 -05:00
Leibale
520441704b fix multi "generic" type, some docs 2023-11-20 13:15:40 -05:00
Leibale
3ca33b8b80 remove unused import 2023-11-20 12:47:22 -05:00