From f1f9c7ac241125b9bcb410f5ad14403a8a94fa20 Mon Sep 17 00:00:00 2001 From: leibale Date: Wed, 10 Nov 2021 14:20:46 -0500 Subject: [PATCH] fix bug in cluster slots, enhance live resharding test --- index.ts | 1 - packages/client/lib/cluster/cluster-slots.ts | 2 +- packages/client/lib/cluster/index.spec.ts | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 7913630a19..3bbb4c9d94 100644 --- a/index.ts +++ b/index.ts @@ -19,4 +19,3 @@ export function createClient>( modules }); } - diff --git a/packages/client/lib/cluster/cluster-slots.ts b/packages/client/lib/cluster/cluster-slots.ts index f65411d797..4c53445b68 100644 --- a/packages/client/lib/cluster/cluster-slots.ts +++ b/packages/client/lib/cluster/cluster-slots.ts @@ -82,7 +82,7 @@ export default class RedisClusterSlots { 10 ); + await Promise.all( + cluster.getMasters().map(({ client }) => { + return client.clusterSetSlot(slot, ClusterSlotStates.NODE, to!.id); + }) + ); + // should be able to get the key from the new node assert.equal( await cluster.get(key),