| 926 | } |
| 927 | |
| 928 | int clusterNodeAddSlave(clusterNode *master, clusterNode *slave) { |
| 929 | int j; |
| 930 | |
| 931 | /* If it's already a slave, don't add it again. */ |
| 932 | for (j = 0; j < master->numslaves; j++) |
| 933 | if (master->slaves[j] == slave) return C_ERR; |
| 934 | master->slaves = zrealloc(master->slaves, |
| 935 | sizeof(clusterNode*)*(master->numslaves+1)); |
| 936 | master->slaves[master->numslaves] = slave; |
| 937 | master->numslaves++; |
| 938 | master->flags |= CLUSTER_NODE_MIGRATE_TO; |
| 939 | return C_OK; |
| 940 | } |
| 941 | |
| 942 | int clusterCountNonFailingSlaves(clusterNode *n) { |
| 943 | int j, okslaves = 0; |
no test coverage detected