Paragrf opened a new pull request, #3378: URL: https://github.com/apache/kvrocks/pull/3378
### Summary This PR aims to provide a streamlined solution for graceful failover within the cluster. Previously, proposed failover schemes remained unmerged due to unresolved complexities and architectural concerns. To address this, this modification introduces the CLIENT PAUSE and CLIENT UNPAUSE commands—capabilities that were previously missing in Kvrocks. These commands provide the necessary primitives to temporarily suspend client traffic, ensuring data consistency and a seamless transition during the failover process. ### Background Based on https://github.com/apache/kvrocks/issues/3377, this PR implements two missing Redis protocols. - Implemented CLIENT PAUSE [timeout] [WRITE|ALL] to block client requests. - Implemented CLIENT UNPAUSE to resume normal operations. ### Implementation The behavior of CLIENT PAUSE/UNPAUSE is consistent with Redis: - Blocking Mechanism: After executing CLIENT PAUSE, Kvrocks will block connections attempting to run restricted commands. - Release/Error Handling: These commands are released once the timeout expires or CLIENT UNPAUSE is called. - Role Transition: If a role change occurs (e.g., Master → Slave) during the pause, any previously blocked write requests will return a READONLY error upon resumption. - Exemption mechanism:master-slave replication, and the PAUSE/UNPAUSE protocols themselves will not be blocked. - Testing:Comprehensive C++ unit tests and Go integration tests have been added -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
