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
Note that the argument 'mystream' in the first command should be 'myprefix:mystream' like it is in the second command.
I think this might be related to #1591 and #1610. Although it doesn't look like @ioredis/commands 1.2.0 will fix the problem, because the commands.json config for xgroup looks wrong.
The text was updated successfully, but these errors were encountered:
To work around this problem, I use this function to wrap my keys before calling stream commands like xgroup, xinfo.
import{getKeyIndexes}from'@ioredis/commands'constneedKeyPrefixHack=getKeyIndexes('xgroup',['CREATE','x','g',0,'MKSTREAM']).length==0exportfunctiongetXgroupKey(k: string,redis: Redis|Cluster){if(needKeyPrefixHack){constprefix=redis.options?.keyPrefixreturnprefix==undefined ? k : `${prefix}${k}`}else{returnk}}
Another problem caused by xgroup not being fully supported is that, in cluster mode, it frequently receives a MOVED reply, which causes ioredis to refresh the slot cache as if the topology had changed. This caused a problem for me because I'm using AWS MemoryDB which occasionally responds slowly to CLUSTER SLOTS, so I was seeing ClusterAllFailedError.
So instead of calling redisConn.xgroup I am calling redisConn.sendCommand, which allows me to influence the original slot by providing getKeys:
Hi, when I enable
keyPrefix
, thexgroup create
command is not respecting the setting.Minimal recreation:
This produces:
Note that the argument
'mystream'
in the first command should be'myprefix:mystream'
like it is in the second command.I think this might be related to #1591 and #1610. Although it doesn't look like
@ioredis/commands
1.2.0 will fix the problem, because the commands.json config forxgroup
looks wrong.The text was updated successfully, but these errors were encountered: