redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.07k stars 1.19k forks source link

Scan command is not working properly in cluster mode with multiple shards #1801

Open rupeshpawarbh opened 10 months ago

rupeshpawarbh commented 10 months ago

scan command gives empty output sometimes when we run it in cluster mode with multiple shards (3 shards). Is there any solution to run scan command in all shards. I have tried to use this code: const masters = cluster.nodes("master"); Promise.all( masters .map((node) => node.keys()) .then((keys) => { // keys: [['key1', 'key2'], ['key3', 'key4']] }) );

but it gives no response

bartoszhernas commented 7 months ago

I have the same issue. It exits really early with CURSOR at '0' even though it didn't scanned it all.

Can it be similar to https://github.com/phpredis/phpredis/issues/2074 ?