Describe the bug
In redis-cli.c,when i create a redis cluster by using clusterManagerCommandCreate(),i find a problem:
static int clusterManagerCommandCreate(int argc, char **argv) {
...
if (confirmWithYes("Can I set the above configuration?", ignore_force)) {
...
sleep(1);
clusterManagerWaitForClusterJoin();
/* Useful for the replicas */
listRewind(cluster_manager.nodes, &li);
while ((ln = listNext(&li)) != NULL) {
clusterManagerNode *node = ln->value;
if (!node->dirty) continue;
char *err = NULL;
int flushed = clusterManagerFlushNodeConfig(node, &err);
if (!flushed && !node->replicate) { // bug here, condition should be !flushed && node->replicate
if (err != NULL) {
CLUSTER_MANAGER_PRINT_REPLY_ERROR(node, err);
zfree(err);
}
success = 0;
goto cleanup;
} else if (err != NULL) {
zfree(err);
}
}
...
}
...
}
when calling clusterManagerFlushNodeConfig() again,only slave can be here,so node->replicate should not be NULL and the condition !flushed && !node->replicate always be false, so i think the condition should be change to !flushed && node->replicate