diff --git a/pkg/scheduler/internal/cache/cache.go b/pkg/scheduler/internal/cache/cache.go index 0775ed05b48..bc17d178bf9 100644 --- a/pkg/scheduler/internal/cache/cache.go +++ b/pkg/scheduler/internal/cache/cache.go @@ -261,12 +261,12 @@ func (cache *schedulerCache) UpdateNodeInfoSnapshot(nodeSnapshot *nodeinfosnapsh cache.updateNodeInfoSnapshotList(nodeSnapshot, updateAllLists) } - if len(nodeSnapshot.NodeInfoList) != len(nodeSnapshot.NodeInfoMap) { - errMsg := fmt.Sprintf("snapshot state is not consistent, length of NodeInfoList=%v not equal to length of NodeInfoMap=%v "+ - "length of nodes in cache=%v, length of nodes in tree=%v"+ + if len(nodeSnapshot.NodeInfoList) != cache.nodeTree.numNodes { + errMsg := fmt.Sprintf("snapshot state is not consistent, length of NodeInfoList=%v not equal to length of nodes in tree=%v "+ + ", length of NodeInfoMap=%v, length of nodes in cache=%v"+ ", trying to recover", - len(nodeSnapshot.NodeInfoList), len(nodeSnapshot.NodeInfoMap), - len(cache.nodes), cache.nodeTree.numNodes) + len(nodeSnapshot.NodeInfoList), cache.nodeTree.numNodes, + len(nodeSnapshot.NodeInfoMap), len(cache.nodes)) klog.Error(errMsg) // We will try to recover by re-creating the lists for the next scheduling cycle, but still return an // error to surface the problem, the error will likely cause a failure to the current scheduling cycle.