• Jonathan Basseri's avatar
    [PATCH] Fix equiv. cache invalidation of Node condition. · f5ab6d5a
    Jonathan Basseri authored
    Equivalence cache for CheckNodeConditionPred becomes invalid when
    Node.Spec.Unschedulable changes. This can happen even if
    Node.Status.Conditions does not change, so move the logic around.
    
    This logic is covered by integration test
    "test/integration/scheduler".TestUnschedulableNodes but equivalence
    cache is currently skipped when test pods have no OwnerReference.
    
    Add benchmark for equivalence hashing.
    
    Change equivalence hash function.
    
    This changes the equivalence class hashing function to use as inputs all
    the Pod fields which are read by FitPredicates. Before we used a
    combination of OwnerReference and PersistentVolumeClaim info, which was
    a close approximation. The new method ensures that hashing remains
    correct regardless of controller behavior.
    
    The PVCSet field can be removed from equivalencePod because it is
    implicitly included in the Volume list.
    
    Tests are now broken.
    
    Move equivalence class hash code.
    
    This moves the equivalence hashing code from
    algorithm/predicates/utils.go to core/equivalence_cache.go.
    
    In the process, making the hashing function and hashing function factory
    both injectable dependencies is removed.
    
    Fix equivalence cache hash tests.
    Co-authored-by: 's avatarJonathan Basseri <misterikkit@google.com>
    Co-authored-by: 's avatarHarry Zhang <resouer@gmail.com>
    f5ab6d5a
utils.go 2.29 KB