Add the specified slot to the list of slots that node 'n' will * serve. Return C_OK if the operation ended with success. * If the slot is already assigned to another instance this is considered * an error and C_ERR is returned. */
| 3943 | * If the slot is already assigned to another instance this is considered |
| 3944 | * an error and C_ERR is returned. */ |
| 3945 | int clusterAddSlot(clusterNode *n, int slot) { |
| 3946 | if (g_pserver->cluster->slots[slot]) return C_ERR; |
| 3947 | clusterNodeSetSlotBit(n,slot); |
| 3948 | g_pserver->cluster->slots[slot] = n; |
| 3949 | return C_OK; |
| 3950 | } |
| 3951 | |
| 3952 | /* Delete the specified slot marking it as unassigned. |
| 3953 | * Returns C_OK if the slot was assigned, otherwise if the slot was |
no test coverage detected