Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing XREADGROUP command in Redis cluster #2140

Closed
adiamzn opened this issue Jul 6, 2022 · 1 comment
Closed

Routing XREADGROUP command in Redis cluster #2140

adiamzn opened this issue Jul 6, 2022 · 1 comment
Labels
type: bug A general bug
Milestone

Comments

@adiamzn
Copy link
Contributor

adiamzn commented Jul 6, 2022

Bug Report

Current Behavior

When using redis cluster,
it seems that the hash slot to which the XREADGROUP command is routed to is calculated using the consumer group rather than the stream.
This can be seen here xreadgroup in RedisCommandBuilder. where consumer.group is added to args with addKey.

Expected behavior/code

The XREADGROUP command should be routed based on stream and not consumer group.

Environment

  • Lettuce version(s): 6.1.8.RELEASE
  • Redis version: 6.x

Possible Solution

perhaps converting the consumer group and consumer name to strings and adding to xreadargs with add() instead of addKey()

@mp911de mp911de added the type: bug A general bug label Jul 6, 2022
@mp911de
Copy link
Collaborator

mp911de commented Jul 6, 2022

That's a bug. The consumer group could be a byte[] or a String and we want to give users a sense of flexibility here.

@mp911de mp911de added this to the 6.1.9.RELEASE milestone Jul 7, 2022
mp911de added a commit that referenced this issue Jul 7, 2022
…mand #2140

Lettuce now encodes the consumer group and name eagerly to pass on these values as byte array instead of deferred key argument encoding to avoid the first-key detection to use consumer group or name as key argument. With this strategy, the stream name is being detected as first key.
mp911de added a commit that referenced this issue Jul 7, 2022
Update Javadoc
mp911de added a commit that referenced this issue Jul 7, 2022
…mand #2140

Lettuce now encodes the consumer group and name eagerly to pass on these values as byte array instead of deferred key argument encoding to avoid the first-key detection to use consumer group or name as key argument. With this strategy, the stream name is being detected as first key.
mp911de added a commit that referenced this issue Jul 7, 2022
Update Javadoc
@mp911de mp911de closed this as completed Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants