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

outlierdetection: Support health listener for ejection updates #7908

Merged
merged 14 commits into from
Dec 23, 2024

Conversation

arjan-bal
Copy link
Contributor

As part of the dualstack changes described in A61, ejection updates need to be delivered through the health listener instead of the raw connectivity listener.

Outlier Detection will continue to support ejection via the regular connectivity listener till all petiole policies start delegating to pickfirst. To make OD aware that it should not send ejection updates on the regular SubConn state listener, similar to c-core, a balancer attribute is set in pickfirst which is is picked up in OD while intercepting NewSubConn() calls.

RELEASE NOTES: N/A

@arjan-bal arjan-bal added Type: Feature New features or improvements in behavior Area: Resolvers/Balancers Includes LB policy & NR APIs, resolver/balancer/picker wrappers, LB policy impls and utilities. labels Dec 6, 2024
@arjan-bal arjan-bal added this to the 1.70 Release milestone Dec 6, 2024
@arjan-bal arjan-bal requested review from easwars and dfawley December 6, 2024 11:44
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 87.91946% with 18 lines in your changes missing coverage. Please review.

Project coverage is 82.16%. Comparing base (e8055ea) to head (b20e018).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...ernal/balancer/outlierdetection/subconn_wrapper.go 82.92% 10 Missing and 4 partials ⚠️
balancer/weightedroundrobin/balancer.go 50.00% 2 Missing and 1 partial ⚠️
xds/internal/balancer/outlierdetection/balancer.go 98.24% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7908      +/-   ##
==========================================
+ Coverage   82.08%   82.16%   +0.08%     
==========================================
  Files         379      379              
  Lines       38261    38360      +99     
==========================================
+ Hits        31406    31519     +113     
+ Misses       5551     5544       -7     
+ Partials     1304     1297       -7     
Files with missing lines Coverage Δ
balancer/endpointsharding/endpointsharding.go 77.38% <100.00%> (-0.53%) ⬇️
balancer/pickfirst/pickfirstleaf/pickfirstleaf.go 87.28% <100.00%> (+0.65%) ⬆️
xds/internal/balancer/outlierdetection/balancer.go 87.56% <98.24%> (-0.07%) ⬇️
balancer/weightedroundrobin/balancer.go 82.87% <50.00%> (-0.61%) ⬇️
...ernal/balancer/outlierdetection/subconn_wrapper.go 85.10% <82.92%> (-14.90%) ⬇️

... and 24 files with indirect coverage changes

Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't reviewed OD changes yet. Have to spend some time refreshing OD :(

@arjan-bal arjan-bal assigned easwars and unassigned arjan-bal Dec 10, 2024
@easwars easwars assigned arjan-bal and unassigned easwars Dec 13, 2024
@arjan-bal arjan-bal assigned easwars and unassigned arjan-bal Dec 16, 2024
Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very close to LGTM. I think one or two points of discussion still.

@easwars easwars assigned arjan-bal and unassigned easwars Dec 16, 2024
@arjan-bal arjan-bal assigned easwars and unassigned arjan-bal Dec 17, 2024
@dfawley dfawley assigned arjan-bal and unassigned dfawley Dec 19, 2024
@arjan-bal arjan-bal assigned dfawley and unassigned arjan-bal Dec 20, 2024
@dfawley dfawley assigned arjan-bal and easwars and unassigned easwars, dfawley and arjan-bal Dec 20, 2024
// to indicate whether the health listener usage is enabled.
type enableHealthListenerKeyType struct{}
type (
// enableHealthListenerKeyType is a unique key type used in resolver attributes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor nit: Please try to wrap comment lines at 80-cols.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapped the comment.

// changes are complete, all SubConns will be created by pick_first and
// outlier detection will only use the health listener for ejection and
// this field can be removed.
healthListenerEnabled bool

// addressInfo is a pointer to the subConnWrapper's corresponding address
// map entry, if the map entry exists.
addressInfo unsafe.Pointer // *addressInfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I brought this up earlier. But the addressInfo field can change during UpdateAddresses. So, I don't think it is correct to have this field under the read-only-after-creation group of fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move it to the top and mentioned that it's accessed atomically.

@easwars easwars assigned arjan-bal and unassigned easwars Dec 20, 2024
@easwars
Copy link
Contributor

easwars commented Dec 20, 2024

Should we release note this? It is not something that is going to be very visible to users, but if at all there is some behavior change that they observe, a release note might be helpful?
@dfawley

@arjan-bal
Copy link
Contributor Author

Should we release note this? It is not something that is going to be very visible to users, but if at all there is some behavior change that they observe, a release note might be helpful? @dfawley

The old mechanism of ejection using the raw connectivity listener should remain unchanged. When petiole policies start delegating to pickfirst, they will start using health listeners. We can add release notes when each policy starts delegating to pickfirst.

@arjan-bal arjan-bal merged commit 10c7e13 into grpc:master Dec 23, 2024
15 checks passed
vinothkumarr227 pushed a commit to vinothkumarr227/grpc-go that referenced this pull request Dec 23, 2024
vinothkumarr227 added a commit to vinothkumarr227/grpc-go that referenced this pull request Dec 23, 2024
@arjan-bal arjan-bal deleted the od-health-listener branch December 30, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Resolvers/Balancers Includes LB policy & NR APIs, resolver/balancer/picker wrappers, LB policy impls and utilities. Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants