feat: event driven range load tracking#198
Merged
Merged
Conversation
We no longer need those constants because split/merge decisions are based on committed segment-roll history, not sampled wall-clock activity. MEASUREMENT_WINDOW_MS: Previously, load had to be measured over a time window: “How much traffic did this range receive during the last N milliseconds?” Now every successful segment roll carries its cause: - DataPressure means the segment filled because of traffic. - IdleMaintenance means it aged out without filling. - Failure, recovery, and correction rolls are neutral. The committed roll itself is the measurement. A separate time window would add timing sensitivity without contributing information SPLIT_COOLDOWN_MS: After a split, each child starts Unclassified with a fresh active segment. It must independently accumulate a complete pressure streak before it can split again. That requires real data to fill multiple segments, which acts as a workload-based cooldown. MERGE_SEAL_THRESHOLD: Merging does not need a numeric streak because there is already a strong physical idle signal: a child’s active segment reaches the age limit and rolls with IdleMaintenance
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.
closes #192
Changes
Introduces a major architectural shift in how EastGuard decides to split or merge ranges, replacing a wall-clock, timestamp-based policy with Event-Driven Range Load Classification.
The core implementation changes include:
RangeLoadState: Ranges now maintain a deterministic load state applied via Raft:Unclassified: No load observed yet (new splits start here).Idle: The latest roll was an idle maintenance roll.Pressure(N): The active segment rolledNconsecutive times due to data pressure.segment_age_check_interval_secsis nowsegment_idle_check_interval_secs.seal_requesttoroll_request, and introducedSegmentRollIntent&PendingSegmentRollRequests.MEASUREMENT_WINDOW_MSandSPLIT_COOLDOWN_MSthat were tied to the older wall-clock based logic.