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.
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
pickfirst: Register a health listener when used as a leaf policy #7832
pickfirst: Register a health listener when used as a leaf policy #7832
Changes from 3 commits
a1517c7
53e7de9
a68c372
cf153cb
13ad224
ce4d36f
be9ca5c
c109eb4
d852260
9d86f5e
886ad2f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
For these types of functions we prefer to make them operate on the thing that contains the attributes. In this case, that would be a
resolver.State
.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.
Changed the function to accept
resolver.State
.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.
I think this deserves a comment, too, since there are now two very similar fields.
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.
Added 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.
Shouldn't this kind of tracking be done in the subconn struct (
scData
) and not here? I would expect the lb policy only has theconcludedState
and each subchannel needs to track its real state and its effective state, accounting for sticky-TF and health reporting? It seems confusing to me that the LB policy itself is tracking two different states, but I'm willing to believe it's simpler this way if you tried it the other way already.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.
I was referring the Java implementation of Pickfirst and they were handling the sticky TF behaviour in the LB Policy. I don't see any issue with handling sticky TF in the subchannel state. I've update the PR to reflect the suggestions.
Check warning on line 514 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L514
Check warning on line 586 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L585-L586
Check warning on line 596 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L595-L596
Check warning on line 718 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L717-L718
Check warning on line 736 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L735-L736
Check warning on line 744 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L743-L744