Cluster: new option to work with partial slots coverage.

This commit is contained in:
antirez
2014-09-17 11:10:09 +02:00
parent a2c740ea93
commit c89afc8e5d
6 changed files with 40 additions and 6 deletions

View File

@ -3171,12 +3171,14 @@ void clusterUpdateState(void) {
new_state = REDIS_CLUSTER_OK;
/* Check if all the slots are covered. */
for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) {
if (server.cluster->slots[j] == NULL ||
server.cluster->slots[j]->flags & (REDIS_NODE_FAIL))
{
new_state = REDIS_CLUSTER_FAIL;
break;
if (server.cluster_require_full_coverage) {
for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) {
if (server.cluster->slots[j] == NULL ||
server.cluster->slots[j]->flags & (REDIS_NODE_FAIL))
{
new_state = REDIS_CLUSTER_FAIL;
break;
}
}
}