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 1 commit
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.
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 512 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L512
Check warning on line 589 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L588-L589
Check warning on line 712 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L711-L712
Check warning on line 730 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L729-L730
Check warning on line 738 in balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Codecov / codecov/patch
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go#L737-L738