Fix manul failover with CLIENT PAUSE/UNPAUSE#389
Open
Paragrf wants to merge 2 commits intoapache:unstablefrom
Open
Fix manul failover with CLIENT PAUSE/UNPAUSE#389Paragrf wants to merge 2 commits intoapache:unstablefrom
Paragrf wants to merge 2 commits intoapache:unstablefrom
Conversation
Contributor
Author
|
In actual testing with the Controller and Kvrocks deployed in the same IDC, the system achieved a single-node write QPS of 10k/s with 20MB/s throughput. The write-stop duration (stall time) remained consistently under 10ms. |
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
Implement Controller modifications to ensure master-replica data consistency during failover, aligning with server-side changes in apache/kvrocks#3377
Solution
Step 1 (Pause): Send CLIENT PAUSE WRITE from the controller to the current master.
Step 2 (Wait): Monitor the master-replica sequence gap until it hits zero, ensuring no data loss.
Step 3 (Metadata): Update the global topology metadata for the switchover.
Step 4 (Switch & Unpause): Promote the target and demote the old master; then explicitly call CLIENT UNPAUSE on the old master to restore its status.
Step 5 (Replicate): Reconfigure all other followers to sync from the new master.
Configuration Options
To prevent excessive blocking durations during periods of high write traffic, a maximum pause timeout has been introduced; the failover process will fail if the synchronization times out. The following parameters are added to the Controller failover configuration:
"force_on_timeout": false,
"sync_timeout_ms": 100,
"pause_timeout_ms": 500
Related Issues
Fixes #384