| 3520 | } |
| 3521 | |
| 3522 | static 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 | |
| 3551 | static int clusterManagerAddSlot(clusterManagerNode *node, int slot) { |
| 3552 | redisReply *reply = CLUSTER_MANAGER_COMMAND(node, |
no test coverage detected