Skip to content
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

Only update a resource's status if it has changed #1151

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

kate-osborn
Copy link
Contributor

Proposed changes

Problem: NGF updates the status of resources even when the status has not changed.
When there are a large number of HTTPRoutes this can significantly decrease processing time.

Solution: Modify the status updater to only update status when it has changed.

Testing: Added unit tests, manually tested changes, and re-ran the scale tests.
The scale test performance numbers significantly improved with this change.

Closes #1013

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@kate-osborn kate-osborn requested a review from a team as a code owner October 17, 2023 19:42
@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation labels Oct 17, 2023
@kate-osborn kate-osborn changed the title Fix/status update Only update a resource's status if it has changed Oct 17, 2023
internal/framework/status/setters.go Outdated Show resolved Hide resolved
internal/framework/status/setters.go Outdated Show resolved Hide resolved
internal/framework/status/setters.go Show resolved Hide resolved
internal/framework/status/setters_test.go Outdated Show resolved Hide resolved
internal/framework/status/updater_test.go Outdated Show resolved Hide resolved
internal/framework/status/setters.go Outdated Show resolved Hide resolved
@kate-osborn kate-osborn merged commit 7cff184 into nginxinc:main Oct 19, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Update the status of a resource only if the status changes
3 participants