-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(pipelinerun): fix the issue of massive invalid status updates caused by unordered arrays, which will greatly impact the resource load and stability of the apiserver. #9295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sed by unordered arrays, which will greatly impact the resource load and stability of the apiserver.
|
/kind bug |
khrm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove cmpopts.SortSlices from pkg/reconciler/pipelinerun/pipelinerun_updatestatus_test.go? It's not needed anymore and will act as a test..
…elinerun/pipelinerun_updatestatus_test.go
Nice suggestion. I removed the unnecessary sorting in pipelinerun_updatestatus_test.go to ensure the consistency of this modification. |
|
/lgtm /assign @waveywaves @vdemeester |
vdemeester
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
To let @afrittoli @waveywaves and @twoGiants to look into it. Thank you for this PR !
I initially thought it could be a problem from the API point of view, but as there was no guarantee it was sorted before..
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |
|
/cherry-pick release-v1.0.x release-v1.3.x release-v1.6.x |
|
✅ Cherry-pick to A new pull request has been created to cherry-pick this change to Please review and merge the cherry-pick PR. |
|
✅ Cherry-pick to A new pull request has been created to cherry-pick this change to Please review and merge the cherry-pick PR. |
|
✅ Cherry-pick to A new pull request has been created to cherry-pick this change to Please review and merge the cherry-pick PR. |
|
/cherry-pick release-v1.6.x |
|
❌ Cherry-pick to The automatic cherry-pick to Output: Next steps:
|
The previous cherry-pick (tektoncd#9314) only included the test file changes (removing cmpopts.SortSlices) but not the actual sorting logic in pipelinerun.go. This caused tests to fail because they expected sorted output but the production code wasn't sorting. This commit adds the missing sort.Slice call that sorts childRefs by PipelineTaskName, then Name, then Kind to prevent excessive status updates caused by unordered arrays. Cherry-pick of the missing part from tektoncd#9295. Signed-off-by: Vincent Demeester <[email protected]> Co-Authored-By: Claude <[email protected]>
The previous cherry-pick (tektoncd#9312) only included the test file changes (removing cmpopts.SortSlices) but not the actual sorting logic in pipelinerun.go. This caused tests to fail because they expected sorted output but the production code wasn't sorting. This commit adds the missing sort.Slice call that sorts childRefs by PipelineTaskName, then Name, then Kind to prevent excessive status updates caused by unordered arrays. Cherry-pick of the missing part from tektoncd#9295. Signed-off-by: Vincent Demeester <[email protected]> Co-Authored-By: Claude <[email protected]>
The test file changes from #9295 were cherry-picked but the actual sorting logic in pipelinerun.go was missing. This adds the sort.Slice call that ensures childRefs are sorted by PipelineTaskName, then Name, then Kind, preventing excessive apiserver status updates caused by non-deterministic map iteration order. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The test file changes from #9295 were cherry-picked but the actual sorting logic in pipelinerun.go was missing. This adds the sort.Slice call that ensures childRefs are sorted by PipelineTaskName, then Name, then Kind, preventing excessive apiserver status updates caused by non-deterministic map iteration order. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The test file changes from #9295 were cherry-picked but the actual sorting logic in pipelinerun.go was missing. This adds the sort.Slice call that ensures childRefs are sorted by PipelineTaskName, then Name, then Kind, preventing excessive apiserver status updates caused by non-deterministic map iteration order. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The test file changes from #9295 were cherry-picked but the actual sorting logic in pipelinerun.go was missing. This adds the sort.Slice call that ensures childRefs are sorted by PipelineTaskName, then Name, then Kind, preventing excessive apiserver status updates caused by non-deterministic map iteration order. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The test file changes from #9295 were cherry-picked but the actual sorting logic in pipelinerun.go was missing. This adds the sort.Slice call that ensures childRefs are sorted by PipelineTaskName, then Name, then Kind, preventing excessive apiserver status updates caused by non-deterministic map iteration order. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changes
We deployed Tekton/Pipeline in a full DevOps environment, creating/deleting approximately four million resources weekly. As business complexity grows, the cluster accumulates large PipelineRun objects (Child TaskRuns > 64), causing severe stability issues with apiserver memory spikes and high write QPS for PipelineRun objects. We identified that the unsorted childRef array in PipelineRun status triggered massive redundant writes. Implementing array sorting significantly mitigates this issue.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes