• Julien Muchembled's avatar
    ERP5: sort balancer families by name before assigning ports · ba9ef609
    Julien Muchembled authored
    If the list of families does not change, their ports must not change, and it's
    wrong to get this by relying on CPython implementation details. Even if we
    automated the update of frontends with new urls, this couldn't be done
    atomically and we'd get random failures.
    
    Currently, frontends are only updated manually so we also want to minimize
    changes when families are added/renamed/removed. By sorting alphabetically,
    we have something predictable. Of course, this does not cover cases like the
    following one:
    - before: A, B, C
    - after: A, C
    Even if we added a 'port-base' parameter for the balancer, the port would
    change for one of the 2 families.
    
    We have no need for the moment, but we could go further with an optional list
    parameter to choose the order, and a special value to skip ports. Another
    option is to use publish-early but it's more complicated to implement and
    we lose everything when we reinstanciate.
    
    The sort in haproxy.cfg.in is for the stats page.
    ba9ef609
instance-balancer.cfg.in 7.96 KB