Files
go/internal
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
..
2023-01-23 08:48:54 +02:00
2023-01-23 08:48:54 +02:00
2023-01-07 16:30:56 +08:00