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
The current implementation of XREADGROUP, XREAD, XGROUP and XINFO uses the ComandValuesMessage this results in an incorrect HashSlot of -1. Using these commands in a cluster environment will result in unnecessary MOVED responses (and round trips).
To fix these command some additional Message types are required. XGROUP and XINFO could be implemented using a CommandValueKeyValuesMessage (first argument is a value, second argument the key and followed by one or more values).
The XREADGROUP and XREAD commands will require a custom Message as they have multiple keys near the end of the command after the STREAMS argument. In redis-server a custom getKeys function has been implemented as well for these commands (see xreadGetKeys in db.c)
The text was updated successfully, but these errors were encountered:
…2093)
I have created a fix for the incorrect HashSlot calculation for the XREAD and XREADGROUP commands (#2086) Since these differ a lot from other messages I have created some new CommandMessage classes:
- SingleStreamReadGroupCommandMessage
- MultiStreamReadGroupCommandMessage
- SingleStreamReadCommandMessage
- MultiStreamReadCommandMessage
The single CommandMessage classes could be removed by only using the multi command messages, but then we have to create a new StreamPostion array and a new StreamPostion object. I wasn't sure which option too choose, so feel free to give input on this (GC vs duplicate code).
There is also some code duplication between the Read and ReadGroup Command messages as the ReadGroup command is very similar to the XREAD but has some additional values in the front of the command (group, consumer, noack). A base class could be created as well to reduce some of the duplication (calculating the hashslot in case of multiple streams and writing the streams part of the commands).
The method CommandAndKey is also not overriden for these Messages as I wasn't which argument of the command to include in the string.
Co-authored-by: Niels Derdaele <niels.derdaele@alsic.be>
Co-authored-by: Nick Craver <nrcraver@gmail.com>
The current implementation of XREADGROUP, XREAD, XGROUP and XINFO uses the ComandValuesMessage this results in an incorrect HashSlot of -1. Using these commands in a cluster environment will result in unnecessary MOVED responses (and round trips).
To fix these command some additional Message types are required. XGROUP and XINFO could be implemented using a CommandValueKeyValuesMessage (first argument is a value, second argument the key and followed by one or more values).
The XREADGROUP and XREAD commands will require a custom Message as they have multiple keys near the end of the command after the STREAMS argument. In redis-server a custom getKeys function has been implemented as well for these commands (see xreadGetKeys in db.c)
The text was updated successfully, but these errors were encountered: