Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors HostDB per-target health tracking by replacing the previous “alive/dead/zombie” terminology with an explicit 3-state model (UP/DOWN/SUSPECT), updating call sites and documentation, and adding unit tests around the new transition behavior.
Changes:
- Refactors
HostDBInfointo a class with private failure-tracking fields and a canonicalstate(now, fail_window)API plus helpers. - Updates host selection / health update call sites to use
is_down(...),is_up(), andmark_active_server_up()naming. - Adds new Catch2 unit tests and wires them into the HostDB build when
BUILD_TESTINGis enabled; updates HostDB developer documentation terminology.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/proxy/http/HttpSM.cc | Updates HostDB health update calls (mark_active_server_up, new increment_fail_count signature). |
| src/mgmt/rpc/handlers/hostdb/HostDB.cc | Adjusts RPC YAML encoding to use new HostDBInfo accessors. |
| src/iocore/hostdb/unit_tests/test_HostDBInfo.cc | Adds unit tests for UP/DOWN/SUSPECT transitions and fail window behavior. |
| src/iocore/hostdb/unit_tests/CMakeLists.txt | Adds a dedicated unit test executable for HostDBInfo. |
| src/iocore/hostdb/HostDBInfo.cc | Implements the new HostDBInfo state model and transition methods. |
| src/iocore/hostdb/HostDB.cc | Updates RR selection logic to use new health helpers (is_down, is_up). |
| src/iocore/hostdb/CMakeLists.txt | Includes the new unit_tests subdirectory under BUILD_TESTING. |
| include/iocore/hostdb/HostDBProcessor.h | Public API surface changes for HostDBInfo and ResolveInfo helpers; updated docs/comments. |
| doc/developer-guide/core-architecture/hostdb.en.rst | Replaces “zombie” terminology with “suspect” and updates behavioral description. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces the "alive/dead/zombie" terminology in HostDBInfo with an explicit three-state model, "up/down/suspect", and cleans up the API surface.
HostDBInfo State
_last_failure + fail_windowelapses.Changes
HostDBInfo class
Documentation
Tests