Skip to content

feat: event driven range load tracking#198

Merged
Migorithm merged 14 commits into
mainfrom
feat/event-driven-range-load-192
Jul 18, 2026
Merged

feat: event driven range load tracking#198
Migorithm merged 14 commits into
mainfrom
feat/event-driven-range-load-192

Conversation

@Migorithm

@Migorithm Migorithm commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

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:

  1. Explicit Segment Roll Intents/Causes : Segment rolls now carry explicit intents (or causes) through Raft consensus, such as:
  • Data Pressure: The segment hit its size limit.
  • Idle Maintenance: The segment hit an inactivity timeout.
  • Replication Failure / Recovery: A node died or replication failed.
  1. Deterministic 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 rolled N consecutive times due to data pressure.
  1. Renaming & Refactoring Terminology
  • Age -> Inactivity: E.g., segment_age_check_interval_secs is now segment_idle_check_interval_secs.
  • Seal Request -> Roll Request: Changed structures like seal_request to roll_request, and introduced SegmentRollIntent & PendingSegmentRollRequests.
  • Deprecated Time-Based Configs: Removed configs like MEASUREMENT_WINDOW_MS and SPLIT_COOLDOWN_MS that were tied to the older wall-clock based logic.

Migorithm added 14 commits July 18, 2026 14:19
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
@Migorithm Migorithm self-assigned this Jul 18, 2026
@Migorithm Migorithm added documentation Improvements or additions to documentation enhancement New feature or request feat labels Jul 18, 2026
@Migorithm Migorithm changed the title feat; event driven range load feat: event driven range load tracking Jul 18, 2026
@Migorithm
Migorithm merged commit bf6939d into main Jul 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace wall-clock range seal history with event-driven load signals

1 participant