Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,9 +1094,9 @@ clusterNode *getNodeByQuery(client *c, int *error_code) {
* error). To do so we set the importing/migrating state and
* increment a counter for every missing key. */
if (clusterNodeIsPrimary(myself) || c->flag.readonly) {
if (n == clusterNodeGetPrimary(myself) && getMigratingSlotDest(c->slot) != NULL) {
if (n == clusterNodeGetPrimary(myself) && getMigratingSlot(c->slot) != NULL) {
migrating_slot = 1;
} else if (getImportingSlotSource(c->slot) != NULL) {
} else if (getImportingSlot(c->slot) != NULL) {
importing_slot = 1;
}
}
Expand Down Expand Up @@ -1260,7 +1260,7 @@ clusterNode *getNodeByQuery(client *c, int *error_code) {
return NULL;
} else {
if (error_code) *error_code = CLUSTER_REDIR_ASK;
return getMigratingSlotDest(c->slot);
return getMigratingSlot(c->slot);
}
}

Expand Down Expand Up @@ -1374,7 +1374,7 @@ int clusterRedirectBlockedClientIfNeeded(client *c) {
/* We send an error and unblock the client if:
* 1) The slot is unassigned, emitting a cluster down error.
* 2) The slot is neither handled by this node, nor being imported. */
if (node != myself && getImportingSlotSource(slot) == NULL) {
if (node != myself && getImportingSlot(slot) == NULL) {
if (node == NULL) {
clusterRedirectClient(c, NULL, 0, CLUSTER_REDIR_DOWN_UNBOUND);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ int clusterNodeIsNoFailover(clusterNode *node);
char *clusterNodeGetShardId(clusterNode *node);
int clusterNodeNumReplicas(clusterNode *node);
clusterNode *clusterNodeGetReplica(clusterNode *node, int replica_idx);
clusterNode *getMigratingSlotDest(int slot);
clusterNode *getImportingSlotSource(int slot);
clusterNode *getMigratingSlot(int slot);
clusterNode *getImportingSlot(int slot);
clusterNode *getNodeBySlot(int slot);
int clusterNodeClientPort(clusterNode *n, int use_tls);
char *clusterNodeHostname(clusterNode *node);
Expand Down
Loading
Loading