return CLUSTER_OP_BAD_INPUT;
}
- if (node->elements != 2) {
- fr_strerror_printf("Cluster map %i node %i has incorrect number of elements, expected 2 got %zu",
- map_idx, node_idx, node->elements);
+ /*
+ * As per the redis docs: https://redis.io/commands/cluster-slots
+ *
+ * Newer versions of Redis Cluster will output, for each Redis instance,
+ * not just the IP and port, but also the node ID as third element of the
+ * array. In future versions there could be more elements describing the
+ * node better. In general a client implementation should just rely on
+ * the fact that certain parameters are at fixed positions as specified,
+ * but more parameters may follow and should be ignored.
+ * Similarly a client library should try if possible to cope with the fact
+ * that older versions may just have the IP and port parameter.
+ */
+ if (node->elements >= 2) {
+ fr_strerror_printf("Cluster map %i node %i has incorrect number of elements, expected at least "
+ "2 got %zu", map_idx, node_idx, node->elements);
return CLUSTER_OP_BAD_INPUT;
}