MCPcopy Create free account
hub / github.com/F-Stack/f-stack / clusterNodeForResharding

Function clusterNodeForResharding

app/redis-6.2.6/src/redis-cli.c:5426–5448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5424}
5425
5426static clusterManagerNode *clusterNodeForResharding(char *id,
5427 clusterManagerNode *target,
5428 int *raise_err)
5429{
5430 clusterManagerNode *node = NULL;
5431 const char *invalid_node_msg = "*** The specified node (%s) is not known "
5432 "or not a master, please retry.\n";
5433 node = clusterManagerNodeByName(id);
5434 *raise_err = 0;
5435 if (!node || node->flags & CLUSTER_MANAGER_FLAG_SLAVE) {
5436 clusterManagerLogErr(invalid_node_msg, id);
5437 *raise_err = 1;
5438 return NULL;
5439 } else if (target != NULL) {
5440 if (!strcmp(node->name, target->name)) {
5441 clusterManagerLogErr( "*** It is not possible to use "
5442 "the target node as "
5443 "source node.\n");
5444 return NULL;
5445 }
5446 }
5447 return node;
5448}
5449
5450static list *clusterManagerComputeReshardTable(list *sources, int numslots) {
5451 list *moved = listCreate();

Callers 1

Calls 2

clusterManagerNodeByNameFunction · 0.85
strcmpFunction · 0.85

Tested by

no test coverage detected