ioredis icon indicating copy to clipboard operation
ioredis copied to clipboard

SCAN on redis cluster in Azure

Open taltal78 opened this issue 11 months ago • 0 comments

Hi, related also to this: https://github.com/redis/ioredis/issues/1884

I have redis cluster with 1 master(2 slaves) Calling scanStream in AWS to get all keys by patterna and delete them it works:

const node = redisClient.nodes('master')[0] 
const stream = node.scanStream({
....

redisClient.del(keys);
....

calling this with azure, i get " Cannot read properties of undefined (reading 'scanStream')" - so redisClient.nodes('master')[0] doesnt exist... is there specific issue with cluster redis in Azure ?

it seems that this happens only sometimes, restart the app, and it successfully connects and found the master/slave nodes... sphoradic issue. Can it be that after some time the cluster master nodes array somehow becomes empty?

P.s.1 will this return all found keys? p.s2 on startup i go over all slaves and execute readOnly


   const slaves = client.nodes('slave');
    Promise.all(slaves.map((node) => {
        node.readonly();

thanks, Tal

taltal78 avatar Jan 27 '25 14:01 taltal78