save checkpoint
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Region-Aware Routing Algorithm
|
||||
|
||||
## Module
|
||||
Router
|
||||
|
||||
## Status
|
||||
IMPLEMENTED
|
||||
|
||||
## Description
|
||||
Full routing algorithm with 3-tier region preference (Tier 0: same region, Tier 1: same continent, Tier 2: cross-continent), ping-based latency selection within tiers, heartbeat recency weighting, and round-robin/random tie-breaking for deterministic load distribution.
|
||||
|
||||
## Implementation Details
|
||||
- **Modules**: `src/Router/__Libraries/StellaOps.Router.Gateway/Routing/`, `src/Router/__Libraries/StellaOps.Router.Gateway/Services/`
|
||||
- **Key Classes**:
|
||||
- `DefaultRoutingPlugin` (`src/Router/__Libraries/StellaOps.Router.Gateway/Routing/DefaultRoutingPlugin.cs`) - implements 3-tier region preference with latency-based selection
|
||||
- `PingTracker` (`src/Router/__Libraries/StellaOps.Router.Gateway/Services/PingTracker.cs`) - tracks ping-based latency measurements per instance
|
||||
- `InMemoryRoutingState` (`src/Router/__Libraries/StellaOps.Router.Gateway/State/InMemoryRoutingState.cs`) - routing state with instance region metadata
|
||||
- **Interfaces**: `IRoutingPlugin`, `IGlobalRoutingState`, `IRegionProvider`
|
||||
- **Source**: batch_51/file_24.md
|
||||
|
||||
## E2E Test Plan
|
||||
- [ ] Register instances in the same region, same continent, and cross-continent, then route a request and verify Tier 0 preference
|
||||
- [ ] Verify latency-based selection: within the same tier, confirm the lowest-latency instance is preferred
|
||||
- [ ] Verify heartbeat recency weighting: stale instances are deprioritized
|
||||
- [ ] Verify round-robin tie-breaking: when latency is equal, confirm requests distribute evenly
|
||||
- [ ] Remove all Tier 0 instances and verify fallback to Tier 1, then Tier 2
|
||||
Reference in New Issue
Block a user