Commit Graph
4 Commits
Author SHA1 Message Date
c4770cde7c fix(error): detect READONLY errors from Lua scripts on read-only replicas (#3769)
When a Lua script containing a write command is executed against a
read-only replica in a Redis Cluster, the error may contain
"-READONLY You can't write against a read only replica" embedded
within a larger error message rather than starting with "READONLY ".

The existing code only checked for the "READONLY " prefix, missing
this format. This caused shouldRetry() and isReadOnlyError() to fail,
preventing automatic retry and connection pool cleanup.

The fix checks for the exact substring
"-READONLY You can't write against a read only replica" which is
specific enough to avoid false positives while catching the Lua
script error format.

Closes #2770

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-09 15:08:05 +03:00
ofekshenawaandGitHub 4edf494293 fix(retry): Add retry mechanism for NOREPLICAS error (#3647) 2025-12-10 18:14:05 +02:00
6c24f600de feat(errors): Introduce typed errors (#3602)
* typed errors

* add error documentation

* backwards compatibility

* update readme, remove Is methods

* Update internal/proto/redis_errors.go

Co-authored-by: Copilot <[email protected]>

* Update internal/proto/redis_errors.go

Co-authored-by: Copilot <[email protected]>

* support error wrapping for io and context errors

* use unwrapping of errors in push for consistency

* add common error types

* fix test

* fix flaky test

* add comments in the example

---------

Co-authored-by: Copilot <[email protected]>
2025-11-19 17:31:54 +02:00
4f09082f6b fix: connection pool timeout, increase retries (#3298)
* fix: connection pool timeout, increase retries

Signed-off-by: monkey <[email protected]>

* fix: add shouldRetry test

Signed-off-by: monkey <[email protected]>

---------

Signed-off-by: monkey <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-03-14 10:05:22 +02:00