[RESP] Add CLIENT PAUSE, CLIENT UNPAUSE, and SHUTDOWN - #2131
Open
ezhang3333 wants to merge 2 commits into
Open
ezhang3333 wants to merge 2 commits into
ezhang3333 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Pause admission has concurrency gaps around cluster commands and killed sessions, and the public cluster interface change is compatibility-breaking.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Redis-compatible client pausing and graceful shutdown, integrating command handling with persistence, replication, background maintenance, and host lifecycle.
Changes:
- Adds
CLIENT PAUSE,CLIENT UNPAUSE, andSHUTDOWN. - Coordinates pause state across sessions and maintenance tasks.
- Adds metadata, documentation, ACL checks, and tests.
File summaries
| File | Description |
|---|---|
website/docs/commands/server.md |
Documents SHUTDOWN. |
website/docs/commands/client.md |
Documents pause commands. |
website/docs/commands/api-compatibility.md |
Marks commands supported. |
test/standalone/Garnet.test/RespServerControlTests.cs |
Tests pause and shutdown behavior. |
test/standalone/Garnet.test/RespCommandTests.cs |
Updates AOF-independent commands. |
test/standalone/Garnet.test.acl/Resp/ACL/RespCommandTests.cs |
Adds ACL coverage. |
playground/CommandInfoUpdater/SupportedCommand.cs |
Registers supported commands. |
main/GarnetServer/Program.cs |
Waits for server shutdown completion. |
libs/server/StoreWrapper.cs |
Owns pause and shutdown state. |
libs/server/Storage/Functions/UnifiedStore/ReadMethods.cs |
Suppresses expiration during pauses. |
libs/server/Storage/Functions/ObjectStore/ReadMethods.cs |
Suppresses object expiration during pauses. |
libs/server/Resp/ShutdownCommand.cs |
Implements shutdown orchestration. |
libs/server/Resp/RespServerSession.cs |
Integrates command admission and shutdown. |
libs/server/Resp/Parser/RespCommandHashLookupData.cs |
Adds parser registrations. |
libs/server/Resp/Parser/RespCommand.cs |
Adds command identifiers. |
libs/server/Resp/ClientCommands.cs |
Implements pause commands. |
libs/server/Objects/ItemBroker/CollectionItemBroker.cs |
Pauses broker mutations. |
libs/server/Cluster/IClusterProvider.cs |
Adds replica synchronization contract. |
libs/server/ClientPauseManager.cs |
Implements pause coordination. |
libs/resources/RespCommandsInfo.json |
Adds command metadata. |
libs/resources/RespCommandsDocs.json |
Adds generated command documentation. |
libs/host/GarnetServer.cs |
Implements coordinated host termination. |
libs/cluster/Server/ClusterProvider.Shutdown.cs |
Waits for replica catch-up. |
Review details
- Files reviewed: 23/23 changed files
- Comments generated: 4
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| public sealed partial class ClusterProvider | ||
| { | ||
| /// <inheritdoc /> | ||
| public void WaitForReplicaSync(TimeSpan timeout, CancellationToken cancellationToken) |
Contributor
Author
|
@microsoft-github-policy-service agree |
…g activity Cluster subcommands that mutate this node's data (slot migration, cluster flush, slot key deletion) no longer bypass pause admission, so they cannot write after SHUTDOWN has established its all-client pause. The rest of the internode path stays exempt so replicas can still catch up while clients are paused. CLIENT KILL now wakes a blocked participant without retiring it, so an in-flight write on the killed session stays visible to the drain until the session actually disposes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Description of Change
Adds Redis-compatible
CLIENT PAUSE,CLIENT UNPAUSE, andSHUTDOWNsupport. Pauses block the applicable client commands while keeping expiration and background maintenance from modifying data. Shutdown coordinates write pausing, replica synchronization, persistence, and host termination.Adds command metadata, documentation, ACL coverage, and control-command tests.
Issues Fixed
Fixes #1004