| 4445 | } |
| 4446 | |
| 4447 | static int clusterManagerIsConfigConsistent(void) { |
| 4448 | if (cluster_manager.nodes == NULL) return 0; |
| 4449 | int consistent = (listLength(cluster_manager.nodes) <= 1); |
| 4450 | // If the Cluster has only one node, it's always consistent |
| 4451 | if (consistent) return 1; |
| 4452 | sds first_cfg = NULL; |
| 4453 | listIter li; |
| 4454 | listNode *ln; |
| 4455 | listRewind(cluster_manager.nodes, &li); |
| 4456 | while ((ln = listNext(&li)) != NULL) { |
| 4457 | clusterManagerNode *node = ln->value; |
| 4458 | sds cfg = clusterManagerGetConfigSignature(node); |
| 4459 | if (cfg == NULL) { |
| 4460 | consistent = 0; |
| 4461 | break; |
| 4462 | } |
| 4463 | if (first_cfg == NULL) first_cfg = cfg; |
| 4464 | else { |
| 4465 | consistent = !sdscmp(first_cfg, cfg); |
| 4466 | sdsfree(cfg); |
| 4467 | if (!consistent) break; |
| 4468 | } |
| 4469 | } |
| 4470 | if (first_cfg != NULL) sdsfree(first_cfg); |
| 4471 | return consistent; |
| 4472 | } |
| 4473 | |
| 4474 | static list *clusterManagerGetDisconnectedLinks(clusterManagerNode *node) { |
| 4475 | list *links = NULL; |
no test coverage detected