Skip to content

Use SHUTDOWN instead of CLUSTER RESET SOFT in del-node#14989

Open
fru1tworld wants to merge 6 commits intoredis:unstablefrom
fru1tworld:fix-14965-del-node-shutdown-option
Open

Use SHUTDOWN instead of CLUSTER RESET SOFT in del-node#14989
fru1tworld wants to merge 6 commits intoredis:unstablefrom
fru1tworld:fix-14965-del-node-shutdown-option

Conversation

@fru1tworld
Copy link
Copy Markdown

@fru1tworld fru1tworld commented Apr 4, 2026

Problem

redis-cli --cluster del-node sends CLUSTER RESET SOFT to the deleted node, leaving it running as a standalone instance. Clients may still connect to this node and receive empty cluster information, causing confusion about whether the cluster exists.

This differs from the original redis-trib.rb behavior which sent SHUTDOWN.

Fix

Send SHUTDOWN NOSAVE instead of CLUSTER RESET SOFT after removing a node from the cluster. This ensures clients get a clear connection failure and retry with other cluster nodes.

Fixes #14965


Note

Low Risk
Low risk because default del-node behavior remains CLUSTER RESET SOFT; the new shutdown behavior is opt-in via a flag. Main risk is operational (terminating a node) when users enable --cluster-shutdown-nosave-on-del.

Overview
Adds an opt-in redis-cli --cluster del-node flag, --cluster-shutdown-nosave-on-del, to shut down the removed node via SHUTDOWN NOSAVE after it is forgotten by the cluster.

If SHUTDOWN fails, del-node falls back to the existing CLUSTER RESET SOFT behavior. New unit tests cover both the default (node remains alive but reset) and the flagged (node process terminates) flows.

Reviewed by Cursor Bugbot for commit 341b11b. Bugbot is set up for automated code reviews on this repo. Configure here.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 4, 2026

CLA assistant check
All committers have signed the CLA.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Apr 4, 2026

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

Comment thread src/redis-cli.c Outdated
@fru1tworld fru1tworld marked this pull request as draft April 4, 2026 12:27
@fru1tworld fru1tworld force-pushed the fix-14965-del-node-shutdown-option branch from 1b59993 to a1ee8bd Compare April 4, 2026 12:28
@fru1tworld fru1tworld force-pushed the fix-14965-del-node-shutdown-option branch from a1ee8bd to 0dda25c Compare April 4, 2026 12:30
@fru1tworld fru1tworld marked this pull request as ready for review April 4, 2026 12:44
@sundb sundb added this to Redis 8.8 Apr 7, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Redis 8.8 Apr 7, 2026
Verify that del-node terminates the removed node's process
(SHUTDOWN NOSAVE) instead of leaving it running as a standalone
instance (CLUSTER RESET SOFT). See redis#14965.
@ShooterIT
Copy link
Copy Markdown
Member

i think del-node doesn't mean we can shutdown the server, it seems a break change, i prefer not to do that

@fru1tworld
Copy link
Copy Markdown
Author

Thanks for the feedback! I agree that shutting down the server on del-node could be a breaking change. I'll look into an alternative approach that keeps CLUSTER RESET SOFT while addressing the original issue.

@fru1tworld fru1tworld marked this pull request as draft April 9, 2026 12:46
@fru1tworld
Copy link
Copy Markdown
Author

Could you share your preferred approach? I'm considering either an opt-in --shutdown flag for del-node, or a server-side change to handle reset node connections differently.

@ShooterIT
Copy link
Copy Markdown
Member

a option for del-node looks good to me, cc @sundb

@fru1tworld
Copy link
Copy Markdown
Author

Added --cluster-shutdown flag for del-node. Default behavior (CLUSTER RESET SOFT) is preserved.

@fru1tworld fru1tworld marked this pull request as ready for review April 10, 2026 05:33
@jjz921024
Copy link
Copy Markdown

@fru1tworld Hi, Thanks for the PR. I have a concern about the parameter name --cluster-shutdown

The name is potentially misleading to users, "cluster-shutdown" strongly implies shutting down the entire cluster, not just the a deleted node. This could cause confusion when users need to perform routine maintenance on a single node, fearing they might accidentally take down the whole cluster.

I'd suggest considering a more precise name that makes the scope clear.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fru1tworld
Copy link
Copy Markdown
Author

Thanks for the suggestion! Renamed --cluster-shutdown to --cluster-shutdown-after-del to make it clear that only the deleted node is shut down, not the entire cluster.

@gentcys
Copy link
Copy Markdown
Contributor

gentcys commented Apr 14, 2026

Just a penny for your thoughts, would it be better that removes cluster from the opt-in flag? In addition, we can specify different shutdown behaviors, e.g., save or no save.
And replace after with on for brevity and clarity.

redis-cli --cluster del-node 127.0.0.1:7000 `<node-id>` --shutdown-no-save-on-del`

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 0dd5281. Configure here.

Comment thread src/redis-cli.c
@fru1tworld
Copy link
Copy Markdown
Author

Updated — the flag is now --cluster-shutdown-nosave-on-del. Kept the --cluster- prefix to stay consistent with the help system, which auto-prepends it to all del-node options. Adopted nosave and on from your suggestion.

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Inconsistency between redis-trib.rb and redis-cli --cluster on del-node

6 participants