Skip to content

[RESP] Add CLIENT PAUSE, CLIENT UNPAUSE, and SHUTDOWN - #2131

Open
ezhang3333 wants to merge 2 commits into
microsoft:mainfrom
ezhang3333:issue-1004-client-pause-shutdown
Open

ezhang3333 wants to merge 2 commits into
microsoft:mainfrom
ezhang3333:issue-1004-client-pause-shutdown

Conversation

@ezhang3333

Copy link
Copy Markdown
Contributor

Description of Change

Adds Redis-compatible CLIENT PAUSE, CLIENT UNPAUSE, and SHUTDOWN support. 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

Copilot AI balanced review requested due to automatic review settings September 14, 2026 04:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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, and SHUTDOWN.
  • 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.

Comment thread libs/server/Cluster/IClusterProvider.cs
Comment thread libs/server/Resp/ClientCommands.cs Outdated
Comment thread libs/server/Resp/RespServerSession.cs Outdated
public sealed partial class ClusterProvider
{
/// <inheritdoc />
public void WaitForReplicaSync(TimeSpan timeout, CancellationToken cancellationToken)
@ezhang3333

Copy link
Copy Markdown
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Requesting support for SHUTDOWN and CLIENT PAUSE, CLIENT UNPAUSE

2 participants