Add lightweight cluster PING/PONG heartbeats with full-refresh safeguards#5
Closed
hpatro wants to merge 2 commits into
Closed
Add lightweight cluster PING/PONG heartbeats with full-refresh safeguards#5hpatro wants to merge 2 commits into
hpatro wants to merge 2 commits into
Conversation
Signed-off-by: Harkrishn Patro <bunty.hari@gmail.com>
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.
Motivation
PING/PONGheader for routine failure detection while preserving existing safety semantics.NOFAILOVER) become slow to propagate under light heartbeats.Description
CLUSTER_NODE_LIGHT_HDR_PING_SUPPORTEDand per-node bookkeeping fieldsfail_report_clear_timeandlast_full_heartbeat_sentinclusterNode(seesrc/cluster_legacy.h).clusterProcessGossipEntries()to allow both fullclusterMsgand lightclusterMsgLighthandling, and addclusterMsgLightcount helpers to validate/process light packets (src/cluster_legacy.c).clusterSendPingWithOptions()andclusterShouldSendFullHeartbeat()to choose between light and full heartbeats; light heartbeats carry compact failure gossip and retransmitted clear entries while full heartbeats still include topology, extensions and metadata (src/cluster_legacy.c).clusterUpdateMyself*/update helpers (useCLUSTER_TODO_BROADCAST_ALL) and ensure periodic per-peer full heartbeats at the configured direct-ping interval (cluster_ping_intervalorcluster_node_timeout/2).CLUSTER_FAIL_REPORT_VALIDITY_MULT * cluster_node_timeoutexpires, preventing stale external reports from causing falseFAILdecisions (src/cluster_legacy.c).tests/unit/cluster/failure-marking.tclwith a retransmit/regression scenario and adjusttests/unit/cluster/cross-version-cluster.tclto reflect mixed-version expectations.Testing
make -C src valkey-server -j4(binary built)../runtest --single unit/cluster/failure-marking --clients 1and the suite completed with all tests passing (regressions for recovery-clear addressed by the implementation).unit/cluster/no-failover-option,unit/cluster/hostnames,unit/cluster/announce-client-ip,unit/cluster/announce-client-ports, andunit/cluster/announced-endpoints, and all executed tests passed../runtest --single unit/cluster/cross-version-cluster --clients 1; mixed-version scenarios that require an external older binary were skipped in this environment (these tests are preserved and exercise fallback/compatibility when run with--other-server-path).Codex Task