Skip to content

Conversation

acco
Copy link

@acco acco commented Mar 13, 2025

GCP Memorystore Redis returns a slightly different error message for the CLUSTER command when running in standalone mode:

ERR unknown command CLUSTER, with args beginning with: SLOTS,

The code currently only supports servers that return 'CLUSTER' wrapped in single quotes and with no additional mention of args.

Copy link
Collaborator

@bjosv bjosv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good finding. When looking into this I notice that the old check only seems to have worked with Redis from the Jurassic era.
I think we should replace current match with your change.
Not sure if its easily tested with current setup, but we can add that separately.

When Redis is running in standalone (un-clustered) mode, it will return error messages in one of two formats:

- ERR This instance has cluster support disabled
- ERR unknown command `CLUSTER`, with args beginning with:

It appears the current error handler is for very old versions of Redis and is safe to remove/replace.
@acco
Copy link
Author

acco commented Mar 14, 2025

Excellent, good thinking @bjosv ! Just updated the commit to only handle the current error message

Lmk if you need anything else

@bjosv
Copy link
Collaborator

bjosv commented Mar 14, 2025

Looks great. I (re-)added the handling of the single quote variant and parts of your comment.
I found out that we had the check to be able handle Redis Sentinel so now that works too.
Since I didn't modify your change it should still work and I will therefor merge.
Thanks!

@bjosv bjosv merged commit c15c4f2 into Nordix:master Mar 14, 2025
2 checks passed
@acco
Copy link
Author

acco commented Mar 14, 2025

Thanks @bjosv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants