In the Openshift environment, the number of pods is scaling up and down, and having a fixed number of site master (max_site_master) may not be the best approach.
I want to propose a site_master_ratio which updates the max_site_master every time a view change happen. The possible value would be between 0 (exclusive) and 1 (inclusive) and it means the ratio of nodes in the view that are "promoted" to site master nodes.
I think it could be as simple as:
public void handleView(View view) { max_site_master = Math.max(max_site_master, site_master_ratio * view.size()) members=view.getMembers(); // First, save the members for routing received messages to local members List<Address> old_site_masters=site_masters; List<Address> new_site_masters=determineSiteMasters(view); ... }
WDYT? Does it make sense?