Skip to content

Support for redis-cluster #23869

Closed
Closed
@pat-s

Description

@pat-s

Feature Description

Using Gitea with redis-cluster seems not possible as of right now.
When attempting so, the following error is thrown by Gitea

gitea 2023/04/01 23:31:36 ...ers/web/auth/auth.go:312:handleSignInFull() [E] [6428bed8] RegenerateSession: regenerate session: CROSSSLOT Keys in request don't hash to the same slot

This is a unique behavior of redis-cluster compared to a single redis installation and must be accounted for on the client side as described in https://dzone.com/articles/resolved-crossslot-keys-error-in-redis-cluster-mod.

When creating keys that could be used by multi-key operations, use hashtags ({…}) to force the keys into the same hash slot. When the key contains a “{…}” pattern, only the substring between the braces, “{” and “}”, is considered to calculate the hash slot.
For example, the keys {user1}:mykey1 and {user1}:mykey2 are hashed to the same hash-slot because only the string inside the braces “{” and “}”, that is, “user1”, is used to compute the hash-slot.

I can't infer if this would be a simple addition or a breaking change but wanted to drop the information about redis-cluster anyhow as I couldn't find a prior discussion about it.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions