crowbar/barclamp-pacemaker — pull request #28 by aspiers (2014-03-13 15:14:28+00:00)
Title: cache haproxy backend server list by (cluster, role)

Based on a discussion this morning with @vuntz ...

N.B. I haven't tested this yet! I also didn't check if there are (m)any barclamps (including outstanding pull requests) which call `haproxy_servers` directly - if so they will need to be changed.

The list of haproxy backend servers for a given cluster and role is the same for every node in the cluster, so it is more logical and legible to cache these lists by `(cluster, role)` tuple than by `(node, role)` tuple.

Except for making the code easier to understand, it should not make any practical difference since the cache is not shared and has to be constructed per node, because calls to `haproxy_servers_for_service` and `haproxy_servers` on a single node should never span multiple clusters.