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

NET-5879 - move the filter for non-passing to occur in the health RPC layer rather than the callers of the RPC #21098

Merged
merged 3 commits into from
May 14, 2024

Conversation

jmurret
Copy link
Contributor

@jmurret jmurret commented May 13, 2024

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 on ServiceSpecificRequest so that callers for Health.ServiceNodes RPC can specify which filtering they want based on health check of a service:

  • no filtering
  • exclude critical
  • include only passing

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

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@jmurret jmurret added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport labels May 13, 2024
@jmurret jmurret requested a review from a team as a code owner May 13, 2024 22:37
@github-actions github-actions bot added type/docs Documentation needs to be created/updated/clarified theme/health-checks Health Check functionality labels May 13, 2024
@jmurret jmurret enabled auto-merge (squash) May 13, 2024 22:49
@jmurret jmurret disabled auto-merge May 13, 2024 22:49
@jmurret jmurret merged commit a975b04 into main May 14, 2024
86 checks passed
@jmurret jmurret deleted the jm/only-passing branch May 14, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry theme/health-checks Health Check functionality type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants