• Nils Goroll's avatar
    shard director: add optional weight parameter to .add_backend() · 8b298014
    Nils Goroll authored
    We implement weights by scaling the number of replicas of each backend.
    The replicas parameter of .reconfigure() remains a minimum.
    
    For existing vtcs, the Debug hashcircle output has been compared
    before/after this change to ensure that behaviour is exactly equivalent.
    
    For for wighted backends, it has been checked that the number of
    instances per host on the hashcircle matches the expectation.
    
    Also refactor and clean up some of the code:
    
    - consistently make the number of ring points a uint32_t
    - some constification
    
    Ref #3276
    
     Conflicts:
    	lib/libvmod_directors/shard_cfg.c
    	lib/libvmod_directors/shard_dir.h
    	lib/libvmod_directors/vmod.vcc
    8b298014