Skip to content

Conversation

@kistlers
Copy link
Contributor

@kistlers kistlers commented Nov 6, 2025

This is an attempt to fix #10546.

In redis and redis cluster, PUBLISH is not sharded. Thus, the first argument does not need to has hto the same cluster slot as all other keys in a lua script. However, on execution of a lua script, redis cluster still checks if all keys in KEYS hash to the same shard.

In #10473 I changed that the unlock channel kay was passed in KEYS instead of ARGV, as AWS Elastic Valkey Cluster uses sharded PubSub and thus SPUBLISH internally and requires, that the first argument of PUBLISH hashes to the same shared as KEYS[1].

However, it can still be passed in ARGV, which makes Redis Cluster work again, without the need for hash tags {...} in the given lock key to control the sharding explicitly.

…unlock script compatible with both redis cluster and AWS Elastic valkey cluster

Signed-off-by: Severin Kistler <kistlerseverin@gmail.com>
@kistlers
Copy link
Contributor Author

kistlers commented Nov 6, 2025

@artembilan, I would like to document the necessary steps for anyone else using the RedisLockRegistry on AWS Elastic Valkey. Where does the main documentation for spring-integration reside, and can I do this?

It is just the requirement to use hash tags in the given redis lock key to control the sharding.

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

This is good.
Re. docs, please, see \src\reference\antora\modules\ROOT\pages\redis.adoc in the project.
And search for the [[redis-lock-registry]] section.

Thanks

…stry

Signed-off-by: Severin Kistler <kistlerseverin@gmail.com>
@kistlers kistlers requested a review from artembilan November 7, 2025 07:54
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Just a couple docs nit-picks.
I can fix them on merge: let me know.
Thanks

Signed-off-by: Severin Kistler <kistlerseverin@gmail.com>
@kistlers kistlers requested a review from artembilan November 8, 2025 07:02
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.

V6.5.3 Redis[Clustered] - "CROSSSLOT Keys in request" when unlock

2 participants