Skip to content

Refactor SERedis.BaseSetAll to set all values at once#395

Open
FatemehFattahi wants to merge 1 commit into
dotnetcore:devfrom
FatemehFattahi:dev
Open

Refactor SERedis.BaseSetAll to set all values at once#395
FatemehFattahi wants to merge 1 commit into
dotnetcore:devfrom
FatemehFattahi:dev

Conversation

@FatemehFattahi

Copy link
Copy Markdown

Refactor SERedis.BaseSetAll to set all values at once

@catcherwong catcherwong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

StackExchange.Redis.RedisCommandException : Multi-key operations must involve a single slot; keys can use 'hash tags' to help this, i.e. '{/users/12345}/account' and '{/users/12345}/contacts' will always be in the same slot

This change will trigger this exception when the redis server is in cluster mode, which requires great attention.

@MoienTajik

Copy link
Copy Markdown
Contributor

Does this exception happened in current unit-tests? How can we reproduce that?

@catcherwong

Copy link
Copy Markdown
Member

Yes.

  1. Running redis in cluster mode, https://redis.io/docs/manual/scaling/
  2. Modify the endpoints of redis in RedisCachingProviderTest.cs
  3. Run unit-tests of SetAll/SetAllAsync methods

@kaykaul

kaykaul commented Aug 18, 2023

Copy link
Copy Markdown

@catcherwong I get the above Multi Key error when I use GetByPrefix API. I'm using redis in cluster mode.

@kaykaul

kaykaul commented Aug 18, 2023

Copy link
Copy Markdown

@catcherwong Could you provide an alternative for GetByPrefix for redis in cluster mode?

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.

4 participants