Skip to content

"Error: All keys in the pipeline should belong to the same slots allocation group" while using ioredis with cluster mode and scaleReads set to "all" #1734

@caldrjir

Description

@caldrjir

I am facing these two errors Error: All keys in the pipeline should belong to the same slots allocation group and ReplyError: MOVED 15980 173.19.0.4:6391 while using ioredis with cluster mode, scaleReads set to all and enableAutoPipelining set to true

  Error: All keys in the pipeline should belong to the same slots allocation group
    at Pipeline.exec (/path/to/folder/node_modules/ioredis/built/Pipeline.js:272:29)
    at Object.moved (/path/to/folder/node_modules/ioredis/built/Pipeline.js:145:31)
    at EventEmitter.handleError (/path/to/folder/node_modules/ioredis/built/cluster/index.js:518:26)
    at Pipeline.fillResult (/path/to/folder/node_modules/ioredis/built/Pipeline.js:138:25)
    at /path/to/folder/node_modules/ioredis/built/Pipeline.js:186:18
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
 ReplyError: MOVED 4657 173.19.0.2:6389
    at new Promise (<anonymous>)
    at executeWithAutoPipelining (/path/to/folder/node_modules/ioredis/built/autoPipelining.js:143:33)
    at EventEmitter.set (/path/to/folder/ioredis/built/utils/Commander.js:95:63)

I tried these two workarounds which worked fine, but they are not wanted

  1. Use a separate .pipeline() for all of our writes and left all reads on the auto pipeline -> everything worked well and without these two errors.
  2. Set scaleReads to master -> everything worked well and without these two errors.

I am using:

  • ioredis: 5.2.4
  • node: v16.15.1
  • npm: 9.2.0
  • redis in cluster mode
    • 3 masters
    • 3 slaves (replicas)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions