fix(dist-cache): enable gossip by default to fix silent node-rejoin failure#115
Merged
Conversation
…ailure Previously, no gossip interval was configured for the distributed memory backend, causing `dist_memory.startGossipIfEnabled` to bail out silently (gossipInterval <= 0). This meant that after a graceful drain and restart, the rejoining node had no mechanism to re-introduce itself to cluster peers: heartbeats only probe nodes already in membership, and the Health endpoint is one-way. The drained node would remain invisible to the rest of the cluster forever. Changes: - Add `defaultGossip = 1s` constant and `GossipInt` env-config field (`HYPERCACHE_GOSSIP_INTERVAL`), defaulting to the heartbeat cadence so gossip + heartbeat together disseminate membership changes within a couple of ticks - Wire `backend.WithDistGossipInterval(cfg.GossipInt)` into `buildHyperCache` - Set `LastAccess` on items handled by the HTTP Set endpoint - Add `TestLoadConfigGossipInterval` pinning both the > 0 default and the env-override path
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.
Previously, no gossip interval was configured for the distributed memory backend, causing
dist_memory.startGossipIfEnabledto bail out silently (gossipInterval <= 0). This meant that after a graceful drain and restart, the rejoining node had no mechanism to re-introduce itself to cluster peers: heartbeats only probe nodes already in membership, and the Health endpoint is one-way. The drained node would remain invisible to the rest of the cluster forever.Changes:
defaultGossip = 1sconstant andGossipIntenv-config field (HYPERCACHE_GOSSIP_INTERVAL), defaulting to the heartbeat cadence so gossip + heartbeat together disseminate membership changes within a couple of ticksbackend.WithDistGossipInterval(cfg.GossipInt)intobuildHyperCacheLastAccesson items handled by the HTTP Set endpointTestLoadConfigGossipIntervalpinning both the > 0 default and the env-override path