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

Function clusterManagerDelSlot

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

Source from the content-addressed store, hash-verified

3520}
3521
3522static int clusterManagerDelSlot(clusterManagerNode *node, int slot,
3523 int ignore_unassigned_err)
3524{
3525 redisReply *reply = CLUSTER_MANAGER_COMMAND(node,
3526 "CLUSTER DELSLOTS %d", slot);
3527 char *err = NULL;
3528 int success = clusterManagerCheckRedisReply(node, reply, &err);
3529 if (!success && reply && reply->type == REDIS_REPLY_ERROR &&
3530 ignore_unassigned_err)
3531 {
3532 char *get_owner_err = NULL;
3533 clusterManagerNode *assigned_to =
3534 clusterManagerGetSlotOwner(node, slot, &get_owner_err);
3535 if (!assigned_to) {
3536 if (get_owner_err == NULL) success = 1;
3537 else {
3538 CLUSTER_MANAGER_PRINT_REPLY_ERROR(node, get_owner_err);
3539 zfree(get_owner_err);
3540 }
3541 }
3542 }
3543 if (!success && err != NULL) {
3544 CLUSTER_MANAGER_PRINT_REPLY_ERROR(node, err);
3545 zfree(err);
3546 }
3547 if (reply) freeReplyObject(reply);
3548 return success;
3549}
3550
3551static int clusterManagerAddSlot(clusterManagerNode *node, int slot) {
3552 redisReply *reply = CLUSTER_MANAGER_COMMAND(node,

Calls 4

freeReplyObjectFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected