MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / clusterManagerDelSlot

Function clusterManagerDelSlot

src/redis-cli.c:3133–3160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3131}
3132
3133static int clusterManagerDelSlot(clusterManagerNode *node, int slot,
3134 int ignore_unassigned_err)
3135{
3136 redisReply *reply = CLUSTER_MANAGER_COMMAND(node,
3137 "CLUSTER DELSLOTS %d", slot);
3138 char *err = NULL;
3139 int success = clusterManagerCheckRedisReply(node, reply, &err);
3140 if (!success && reply && reply->type == REDIS_REPLY_ERROR &&
3141 ignore_unassigned_err)
3142 {
3143 char *get_owner_err = NULL;
3144 clusterManagerNode *assigned_to =
3145 clusterManagerGetSlotOwner(node, slot, &get_owner_err);
3146 if (!assigned_to) {
3147 if (get_owner_err == NULL) success = 1;
3148 else {
3149 CLUSTER_MANAGER_PRINT_REPLY_ERROR(node, get_owner_err);
3150 zfree(get_owner_err);
3151 }
3152 }
3153 }
3154 if (!success && err != NULL) {
3155 CLUSTER_MANAGER_PRINT_REPLY_ERROR(node, err);
3156 zfree(err);
3157 }
3158 if (reply) freeReplyObject(reply);
3159 return success;
3160}
3161
3162static int clusterManagerAddSlot(clusterManagerNode *node, int slot) {
3163 redisReply *reply = CLUSTER_MANAGER_COMMAND(node,

Calls 4

zfreeFunction · 0.85
freeReplyObjectFunction · 0.85

Tested by

no test coverage detected