You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Slot calculations for Xgroup commands are incorrect. It turns out that when f.e. XGroupCreateMkStream function is called the func cmdFirstKeyPos(cmd Cmder) int function returns wrong pos number (It returns 1 instead of 2). As a result of this, the function func Slot(key string) int always receives value "create" as argument. This causes incorrectly calculated slot number. Redis will almost always respond with MOVED error and then the command will be resent to the correct node. This bug is related to issue #2978. I will try to provide PR with a fix.
Expected Behavior
Client should calculate slot for a given key correctly.
Current Behavior
Client does not calculate slot for a given key correctly.
Possible Solution
Use cmd.SetFirstKeyPos(2) in func (c cmdable) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd and in others.
Steps to Reproduce
Start redis in cluster mode
Call function XGroupCreate with valid arguments
The text was updated successfully, but these errors were encountered:
Slot calculations for Xgroup commands are incorrect. It turns out that when f.e. XGroupCreateMkStream function is called the
func cmdFirstKeyPos(cmd Cmder) int
function returns wrong pos number (It returns 1 instead of 2). As a result of this, the functionfunc Slot(key string) int
always receives value "create" as argument. This causes incorrectly calculated slot number. Redis will almost always respond with MOVED error and then the command will be resent to the correct node. This bug is related to issue #2978. I will try to provide PR with a fix.Expected Behavior
Client should calculate slot for a given key correctly.
Current Behavior
Client does not calculate slot for a given key correctly.
Possible Solution
Use cmd.SetFirstKeyPos(2) in
func (c cmdable) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd
and in others.Steps to Reproduce
The text was updated successfully, but these errors were encountered: