Verify replica replication catch-up during rolling updates#25
Merged
Conversation
Add ReplicationInfo struct and ParseInfoReplication() function to parse INFO REPLICATION output from Valkey nodes, extracting role, master_link_status, master_sync_in_progress, master_repl_offset, and slave_repl_offset fields. Handles the valkey-go client's "txt:" prefix and \r\n line endings. Enhance isValkeyClusterHealthy() to check that all replicas have caught up with their masters before allowing the next pod deletion during rolling updates. This prevents data loss when the next pod to be deleted is the master of a shard whose replica hasn't finished syncing. For each replica, checks: 1. master_link_status is "up" 2. master_sync_in_progress is 0 3. slave_repl_offset is within 1024 bytes of master_repl_offset If any replica fails these checks, the rolling update is deferred and requeued after 30 seconds. Includes 7 test cases for ParseInfoReplication covering: master node, fully caught-up replica, replica with lag, full sync in progress, link down without sync, txt: prefix handling, and carriage return handling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Add ReplicationInfo struct and ParseInfoReplication() function to parse
INFO REPLICATION output from Valkey nodes, extracting role,
master_link_status, master_sync_in_progress, master_repl_offset, and
slave_repl_offset fields. Handles the valkey-go client's "txt:" prefix
and \r\n line endings.
Enhance isValkeyClusterHealthy() to check that all replicas have caught
up with their masters before allowing the next pod deletion during
rolling updates. This prevents data loss when the next pod to be deleted
is the master of a shard whose replica hasn't finished syncing.
For each replica, checks:
If any replica fails these checks, the rolling update is deferred and
requeued after 30 seconds.
Includes 7 test cases for ParseInfoReplication covering: master node,
fully caught-up replica, replica with lag, full sync in progress, link
down without sync, txt: prefix handling, and carriage return handling.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com