Skip to content
  • Iustin Pop's avatar
    Fix bug in non-mirrored instance allocation · 14b5d45f
    Iustin Pop authored
    
    
    The function `allocateOnSingle' has a bug in the calculation of the
    cluster score used for deciding which of the many target nodes to use
    in placing the instance: it uses the original node list for the score
    calculation.
    
    Due to this, since the original node list is the same for all target
    nodes, it means that basically `allocateOnSingle' returns the same
    score, no matter the target node, and hence the choosing of the node
    is arbitrary, instead of being done on the basis of the algorithm.
    
    This has gone uncaught until reported because the unittests only test
    1 allocation at a time on an empty cluster, and do not check the
    consistency of the score. I'll send separate patches on the master
    branch for adding more checks to prevent this in the future.
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
    14b5d45f