cockroachdb / cockroachdb/cockroach
cli,kv: no guaranteed state switch from DECOMMISSIONING to DECOMMISSIONED if `node decommission` stops early
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Filing the issue on behalf of @mdlinville and @a-entin
**Describe the problem**
If EITHER
1) the user ran the `cockroach node decommission --wait=all` command and then interrupted it (e.g. ctrl+c);
OR
2) the user ran `cockroach node decommission --wait=none`.
In that case, the flip from "DECOMMISSIONING" to "DECOMMISSIONED" will not happen.
The reason for that is that the state flip is effected by the CLI program at the end. Only the CLI (or its underlying API call) is able to finalize the "decommissioned" state. So if you interrupt the command, or do `--wait=none`, it will only flip to "decommissioned" when you run the CLI program again after decommissioning has done all its work.
**Expected behavior**
The state flip from "DECOMMISSIONING" to "DECOMMISSIONED" should be done automatically by the cluster even when the CLI Command is stopped before decommissioning completes.
**Context:**
Slack thread https://cockroachlabs.slack.com/archives/C01PHNMUFLN/p1670361351636919
**Environment:**
- CockroachDB version v22.2
-
Jira issue: CRDB-22888
Contributor guide
Assessment
This issue has not been assessed yet.