Repository navigation
perf: coalesce ring heartbeat ticks at one second - #252
Merged
Merged
Conversation
Greptile SummaryThe PR coalesces ring heartbeat periods to a one-second minimum, matching ring timestamp precision and avoiding redundant CAS and delegate work.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "perf: coalesce ring heartbeats at one se..." | Re-trigger Greptile |
perfloop
Bot
force-pushed
the
perfloop-pr-open-5g7prhpq1a
branch
from
September 2, 2026 10:39
ce7ab1b to
604f41e
Compare
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
ovaistariq
force-pushed
the
perfloop-pr-open-5g7prhpq1a
branch
from
September 9, 2026 22:45
604f41e to
f7db423
Compare
Contributor
|
Rebased onto main ( |
ovaistariq
approved these changes
Sep 9, 2026
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.
Ring timestamps use Unix-second precision, so the 500 ms heartbeat default can retry a CAS without changing membership. Each retry also repeats the heartbeat delegate work.
Set the default and minimum effective ring heartbeat period to one second. Sub-second configurations are intentionally clamped because the stored timestamp cannot represent that cadence. Longer configured periods remain unchanged, the existing 60-second heartbeat-timeout floor remains in place, and state transitions continue to use their direct path. The benchmark captures its measurement endpoint before stopping the lifecycler and keeps the seeded instance in the ring during teardown, so shutdown CAS operations stay outside the heartbeat metrics.
Workload:
single local memberlist ring lifecycler heartbeat with 8 seeded members, 1 token, 100ms sampling steps, and a 10s benchmark windowWorkload:
single local memberlist ring lifecycler heartbeat with 8 seeded members, 1 token, 100ms sampling steps, and a 10s benchmark windowcas-attempts/heartbeatheartbeat-callbacks/heartbeatTests:
make test-coordinatormake test-integration-coordinatormake lintmake license-checkGenerated by Perfloop. Measurements and checks.
Note
Medium Risk
Changes cluster liveness update frequency and clamps custom sub-second heartbeat_period values, which can slightly delay ring timestamp updates but reduces KV/gossip load; failure detection still governed by the 60s timeout floor.
Overview
Aligns ring heartbeat cadence with one-second timestamp precision in the KV ring: default
DefaultHeartbeatPeriodmoves from 500ms to 1s, andMinHeartbeatPeriodpluseffectiveHeartbeatPeriodclamp sub-second settings inApplyDefaultsandToBasicLifecyclerConfigso dskit no longer ticks faster than stored timestamps can change—cutting redundant memberlist CAS attempts and duplicate heartbeat delegate work (benchmark reports ~1 CAS attempt and ~1 callback per successful heartbeat vs ~2.2 before).Adds
BenchmarkRingHeartbeatandmake build-bench-ring-heartbeatfor Perfloop-style precompiled runs, with metrics captured before lifecycler teardown so shutdown CAS is excluded. Tests cover sub-second flooring; cluster and RFC-007 docs now describe the 1s minimum and coalescing behavior.Reviewed by Cursor Bugbot for commit f7db423. Bugbot is set up for automated code reviews on this repo. Configure here.