Repository navigation
List StatefulSets once per buildCR pass instead of a Get per host - #2134
Merged
Merged
Conversation
buildCR read each host's StatefulSet twice per pass, in fillCurSTS and in the status check, and the pass usually runs twice, so a reconcile did about 4 live GETs per host before touching the first one. Each pass now does one live List with the CR selector and both reads use it: the clientset for CHI, apiReader (not the cache) for Keeper. A host the List misses, or every host if it fails, is still read by name as before. Other callers of the status check keep their fresh Get. Fixes Altinity#2063 Signed-off-by: Shubham Kapoor <66124414+shubhamkapoor01@users.noreply.github.com>
alex-zaitsev
self-requested a review
November 3, 2026 07:18
alex-zaitsev
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2063
Each reconcile read every host's StatefulSet about 4 times before touching the first host: twice per pass, and the pass usually runs twice.
Now each pass does one live List and reuses it. For Keeper the List goes through apiReader, so it stays live like the Gets.
Hosts missing from the List, or all hosts if the List fails, are still read by name. Later status checks keep their fresh Get.
StatefulSet requests per reconcile, from the new unit tests:
The count tests fail on 0.28.0.
go test -vet=off -race -count=1 ./pkg/...passes in golang:1.27.3.next-releasebranch, not intomasterbranch.