NET-5879 - move the filter for non-passing to occur in the health RPC layer rather than the callers of the RPC #21098
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.
Description
Move the logic of only passing to the HealthService.ServiceNodes RPC rather than having all callers implement it. This is part of the work exposing supplying sameness groups to the health endpoint / blocking queries that is needed for allowing consul-template to query services based on sameness groups. This PR was broken out to make the work easier to read and the sameness group stuff is in https://github.com/hashicorp/consul-enterprise/pull/9112.
This defines a
HealthFilterType
onServiceSpecificRequest
so that callers forHealth.ServiceNodes
RPC can specify which filtering they want based on health check of a service:This work is needed for the follow up sameness group because the current sameness group logic loops through the sameness group members looking for the first healthy member. In scenarios where the first N members are not healthy, the logic will would wind up creating multiple blocking queries for each member until it found a healthy one. This PR ensures that the sameness group logic can do the filtering within 1 blocking query.
Testing & Reproduction steps
Links
PR Checklist