Conversation
#24 added a ready-replica quorum gate because the readiness loop only iterates pods that are already Running, so a replica being recreated was invisible and the gate passed on an empty set. Upstream solved the same problem in redisPodsSettled, and solved it better: it counts pods against spec.redis.replicas and waits while any is terminating, rather than inferring from whichever replicas happen to answer. Carrying two implementations of one guard is how a fork drifts, so take theirs. Port util.PodIsReady and redisPodsSettled verbatim, drop our quorum gate, and replace our bespoke test with upstream's table test - adapted only where the master rows differ, since a stale master is now promoted away rather than deleted. What remains ours is the handover itself (#26), which is proposed upstream as Saremox#201. If that lands, this file converges.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Sep 29, 2026
This branch has not been deployed
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.
Preparing the upstream PR (Saremox#201) turned up that upstream already fixed half of #23, differently and better.
Their
redisPodsSettled:That closes the same hole our #24 quorum gate closed, by counting pods against the expected replica count rather than inferring from whichever replicas happen to answer. Their test table even has the cases by name: a pod is being deleted, the deleted pod is not recreated yet, the recreated pod is not ready yet.
Carrying two implementations of one guard is how a fork drifts, so this takes theirs.
Changes
operator/redisfailover/util/pod.go(PodIsReady) andredisPodsSettledverbatim.readyReplicascounter.TestUpdateRedisesPodsWaitsForReplicaQuorumwith upstream'sTestUpdateRedisesPodsWaitsForTheLastReplacement, plus theirsettledK8sServices/redisPodhelpers. Adapted only where the master rows differ — a stale master is promoted away, not deleted.What stays ours
The handover itself (#26): promote before replacing the master pod. Upstream still does
DeletePod(master)unconditionally and elects afterwards. That is proposed as Saremox#201; if it lands, this file converges with upstream entirely.Verification
Full suite green,
gofmtandgo vetclean. The adopted check is load-bearing: removing theredisPodsSettledcall fails all pods up and a pod is being deleted.Note we are still 24 commits behind upstream overall, including three worth having — Saremox#196 (fsGroup on the pod not the container, the warning on every helm upgrade), Saremox#182 (disconnect a demoted master's clients), Saremox#193 (don't promote while a ready pod doesn't answer). A full sync is a separate piece of work.