diff --git a/pkg/scheduler/eventhandlers.go b/pkg/scheduler/eventhandlers.go index 85cbdb8741d..2a7032eee71 100644 --- a/pkg/scheduler/eventhandlers.go +++ b/pkg/scheduler/eventhandlers.go @@ -108,11 +108,6 @@ func (sched *Scheduler) deleteNodeFromCache(obj interface{}) { return } klog.V(3).InfoS("Delete event for node", "node", klog.KObj(node)) - // NOTE: Updates must be written to scheduler cache before invalidating - // equivalence cache, because we could snapshot equivalence cache after the - // invalidation and then snapshot the cache itself. If the cache is - // snapshotted before updates are written, we would update equivalence - // cache with stale information which is based on snapshot of old cache. if err := sched.SchedulerCache.RemoveNode(node); err != nil { klog.ErrorS(err, "Scheduler cache RemoveNode failed") } @@ -218,11 +213,6 @@ func (sched *Scheduler) updatePodInCache(oldObj, newObj interface{}) { return } - // NOTE: Updates must be written to scheduler cache before invalidating - // equivalence cache, because we could snapshot equivalence cache after the - // invalidation and then snapshot the cache itself. If the cache is - // snapshotted before updates are written, we would update equivalence - // cache with stale information which is based on snapshot of old cache. if err := sched.SchedulerCache.UpdatePod(oldPod, newPod); err != nil { klog.ErrorS(err, "Scheduler cache UpdatePod failed", "oldPod", klog.KObj(oldPod), "newPod", klog.KObj(newPod)) } @@ -247,11 +237,6 @@ func (sched *Scheduler) deletePodFromCache(obj interface{}) { return } klog.V(3).InfoS("Delete event for scheduled pod", "pod", klog.KObj(pod)) - // NOTE: Updates must be written to scheduler cache before invalidating - // equivalence cache, because we could snapshot equivalence cache after the - // invalidation and then snapshot the cache itself. If the cache is - // snapshotted before updates are written, we would update equivalence - // cache with stale information which is based on snapshot of old cache. if err := sched.SchedulerCache.RemovePod(pod); err != nil { klog.ErrorS(err, "Scheduler cache RemovePod failed", "pod", klog.KObj(pod)) } @@ -416,8 +401,6 @@ func addAllEventHandlers( } case framework.Service: // ServiceAffinity: affected by the selector of the service is updated. - // Also, if new service is added, equivalence cache will also become invalid since - // existing pods may be "captured" by this service and change this predicate result. informerFactory.Core().V1().Services().Informer().AddEventHandler( buildEvtResHandler(at, framework.Service, "Service"), )