[Store] Throttle repeated no-master client logs via LOG_EVERY_T (follow-up to #2484) - #1
Open
silas-scitix wants to merge 1 commit into
Open
[Store] Throttle repeated no-master client logs via LOG_EVERY_T (follow-up to #2484)#1silas-scitix wants to merge 1 commit into
silas-scitix wants to merge 1 commit into
Conversation
…ow-up to kvcache-ai#2484) During a persistent no-master window, the storage heartbeat loop (StorageHeartbeatThreadMain) and the leader monitor loop (LeaderMonitorThreadMain) re-emit the same failure log on every retry (fail_ping_interval_ms / kErrorRetryInterval, ~1s). With many clients this becomes a log storm that drowns out other diagnostics and grows the log volume linearly with the client count. This is a follow-up to kvcache-ai#2484, which introduced the heartbeat/leader-monitor retry loops. Wrap each repeating no-master log site with glog's built-in LOG_EVERY_T(SEV, 30) so a given call site emits at most once per 30 wall-seconds per process while preserving the original message text, severity, and the first occurrence. No throttle helper is hand-rolled; the built-in glog macro is used directly. Sites changed (mooncake-store/src/client_service.cpp): StorageHeartbeatThreadMain: "Failed to ping master", "Failed to get new master view", "No active master view is published yet", "Failed to connect to master", "Failed to ping master for N times (non-HA)", "Reconnect failed to". LeaderMonitorThreadMain: "Failed to wait for leader view change", "Failed to switch to leader". The one-shot connect logs in ConnectToMaster are intentionally left unthrottled (they fire once per connect attempt, not in a retry loop). Behavior is unchanged except for log frequency: retry intervals, sleeps, ping_fail_count, and reconnect control flow are untouched. Build is GREEN and ctest shows no regression on the heartbeat, reconnect, and HA recovery tests; clang-format check passes.
silas-scitix
force-pushed
the
feat/throttle-no-master-logs-glog
branch
from
June 23, 2026 09:59
442e804 to
93375d8
Compare
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.
What
This is a follow-up to kvcache-ai#2484. During a persistent no-master window, the
storage heartbeat loop (
StorageHeartbeatThreadMain) and the leadermonitor loop (
LeaderMonitorThreadMain) re-emit the same failure log onevery retry (
fail_ping_interval_ms/kErrorRetryInterval, ~1s). With alarge number of clients this becomes a log storm that drowns out other
diagnostics and grows the log volume linearly with the client count.
This wraps each repeating no-master log site with glog's built-in
LOG_EVERY_T(SEV, 30), so each call site emits at most once per 30wall-seconds per process while keeping the original message text,
severity, and the first occurrence. No throttle helper is hand-rolled;
the built-in glog macro is used directly.
Sites changed (mooncake-store/src/client_service.cpp)
StorageHeartbeatThreadMain(heartbeat ping/reconnect loop):LeaderMonitorThreadMain:Not changed
The one-shot connect logs in
ConnectToMasterare intentionally leftunthrottled (they fire once per connect attempt, not in a retry loop).
Behavior
Behavior-neutral except for log frequency. Retry intervals, sleeps,
ping_fail_count, and reconnect control flow are untouched; only theLOG()call at each repeating site is swapped for the throttled glogmacro.
Testing
7e9bdde).scripts/code_format.sh --checkpasses (clang-format clean on thechanged file).
(
non_ha_reconnect_test,ha_recovery_test,ha_backend_availability_test,client_integration_test,master_service_test,client_metrics_test).