Skip to content

Commit

Permalink
kernel bug lead to StatefulSet pod metric residue old node and then l…
Browse files Browse the repository at this point in the history
…ead to cpu usage value is very large

(cherry picked from commit 82a7323)
  • Loading branch information
sleepyzhang authored and roczzhang committed Dec 26, 2023
1 parent 07d66a0 commit f3598bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/storage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ type MetricsPoint struct {
}

func resourceUsage(last, prev MetricsPoint) (corev1.ResourceList, api.TimeInfo, error) {
if last.StartTime.Before(prev.StartTime) {
return corev1.ResourceList{}, api.TimeInfo{}, fmt.Errorf("unexpected decrease in startTime of node/container")
}
if last.CumulativeCpuUsed < prev.CumulativeCpuUsed {
return corev1.ResourceList{}, api.TimeInfo{}, fmt.Errorf("unexpected decrease in cumulative CPU usage value")
}
Expand Down

0 comments on commit f3598bf

Please sign in to comment.